This is an automated email from the ASF dual-hosted git repository. jihao pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git
The following commit(s) were added to refs/heads/master by this push: new 7cd5221 [TE] frontend - harleyjj/error-msgs - focus on errors in preview and detection validation (#6016) 7cd5221 is described below commit 7cd5221e2407abdac8fb4da423332753f94473a0 Author: Harley Jackson <hjack...@linkedin.com> AuthorDate: Wed Sep 16 10:07:48 2020 -0700 [TE] frontend - harleyjj/error-msgs - focus on errors in preview and detection validation (#6016) --- .../app/pods/components/alert-details/component.js | 3 ++- .../pods/components/detection-yaml/component.js | 25 ++++++++++++++++++++-- .../pods/components/detection-yaml/template.hbs | 4 ++-- .../app/pods/manage/yaml/controller.js | 14 +++++++++++- .../app/pods/manage/yaml/template.hbs | 2 ++ .../app/pods/self-serve/create-alert/controller.js | 21 +++++++++++++++--- .../app/pods/self-serve/create-alert/template.hbs | 3 +++ 7 files changed, 63 insertions(+), 9 deletions(-) diff --git a/thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js b/thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js index ba665e4..3caaea4 100644 --- a/thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js +++ b/thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js @@ -1166,7 +1166,6 @@ export default Component.extend({ }) .catch(error => { if (error.name !== 'TaskCancelation') { - this.get('notifications').error(error, 'Error', toastOptions); set(this, 'getAnomaliesError', true); if (this.get('isPreviewMode')) { this.get('sendPreviewError')({ @@ -1174,6 +1173,8 @@ export default Component.extend({ previewErrorMsg: 'There was an error generating the preview.', previewErrorInfo: error }); + } else { + this.get('notifications').error(error, 'Error', toastOptions); } } }); diff --git a/thirdeye/thirdeye-frontend/app/pods/components/detection-yaml/component.js b/thirdeye/thirdeye-frontend/app/pods/components/detection-yaml/component.js index 910e249..854c954 100644 --- a/thirdeye/thirdeye-frontend/app/pods/components/detection-yaml/component.js +++ b/thirdeye/thirdeye-frontend/app/pods/components/detection-yaml/component.js @@ -46,6 +46,7 @@ export default Component.extend({ detectionError: false, detectionErrorMsg: null, detectionErrorInfo: null, + detectionErrorScroll: false, init() { @@ -59,6 +60,24 @@ export default Component.extend({ } }, + didRender() { + this._super(...arguments); + if (this.get('detectionErrorScroll')) { + document.getElementById("detection-error").scrollIntoView(); + const parentResetScroll = this.get('resetScroll'); + // reset detectionErrorScroll in parent if present, then set in component + parentResetScroll ? parentResetScroll('detectionErrorScroll') : null; + set(this, 'detectionErrorScroll', false); + } + if (this.get('previewErrorScroll')) { + document.getElementById("preview-error").scrollIntoView(); + const parentResetScroll = this.get('resetScroll'); + // reset previewErrorScroll in parent if present, then set in component + parentResetScroll ? parentResetScroll('previewErrorScroll') : null; + set(this, 'previewErrorScroll', false); + } + }, + /** * Calls api's for specific metric's autocomplete * @method _loadAutocompleteById @@ -288,7 +307,8 @@ export default Component.extend({ this.setProperties({ detectionError: true, detectionErrorMsg: alert_json.message, - detectionErrorInfo: alert_json["more-info"] + detectionErrorInfo: alert_json["more-info"], + detectionErrorScroll: true }); } else { notifications.success('Detection configuration saved successfully', 'Done', toastOptions); @@ -298,7 +318,8 @@ export default Component.extend({ this.setProperties({ detectionError: true, detectionErrorMsg: 'Error while saving detection config.', - detectionErrorInfo: error + detectionErrorInfo: error, + detectionErrorScroll: true }); } } diff --git a/thirdeye/thirdeye-frontend/app/pods/components/detection-yaml/template.hbs b/thirdeye/thirdeye-frontend/app/pods/components/detection-yaml/template.hbs index db88e48..deb2c16 100644 --- a/thirdeye/thirdeye-frontend/app/pods/components/detection-yaml/template.hbs +++ b/thirdeye/thirdeye-frontend/app/pods/components/detection-yaml/template.hbs @@ -21,7 +21,7 @@ </div> {{#if previewError}} <div class="col-xs-12"> - <div class="detection-yaml-msg-preview"> + <div class="detection-yaml-msg-preview" id="preview-error"> <p>{{material-design-icon name='error-outline' }} {{previewErrorMsg}} @@ -49,7 +49,7 @@ {{/if}} {{#if detectionError}} <div class="col-xs-12"> - <div class="detection-yaml-msg"> + <div class="detection-yaml-msg" id="detection-error"> <p><i class="detection-yaml-msg__icon--error glyphicon glyphicon-remove-circle"></i>{{detectionErrorMsg}} {{#if detectionErrorInfo}} <span class="detection-yaml-msg__tooltip-link" onclick={{action "toggleDetectionModal"}}> diff --git a/thirdeye/thirdeye-frontend/app/pods/manage/yaml/controller.js b/thirdeye/thirdeye-frontend/app/pods/manage/yaml/controller.js index 1bef908..3cb4330 100644 --- a/thirdeye/thirdeye-frontend/app/pods/manage/yaml/controller.js +++ b/thirdeye/thirdeye-frontend/app/pods/manage/yaml/controller.js @@ -23,6 +23,7 @@ export default Controller.extend({ previewError: false, previewErrorMsg: null, previewErrorInfo: null, + previewErrorScroll: false, /** * Change subscription group button text depending on whether creating or updating @@ -150,11 +151,22 @@ export default Controller.extend({ this.setProperties({ previewError: bubbledObject.previewError, previewErrorMsg: bubbledObject.previewErrorMsg, - previewErrorInfo: bubbledObject.previewErrorInfo + previewErrorInfo: bubbledObject.previewErrorInfo, + previewErrorScroll: bubbledObject.previewError }); }, /** + * set property value to false + * @method resetErrorScroll + * @param {string} propertyName - name of property to reset (ie 'detectionErrorScroll') + * @return {undefined} + */ + resetErrorScroll(propertyName) { + set(this, propertyName, false); + }, + + /** * update the subscription yaml string and activates 'create group' button * @method updateSubscriptionYaml * @return {undefined} diff --git a/thirdeye/thirdeye-frontend/app/pods/manage/yaml/template.hbs b/thirdeye/thirdeye-frontend/app/pods/manage/yaml/template.hbs index 29a479e..20c6557 100644 --- a/thirdeye/thirdeye-frontend/app/pods/manage/yaml/template.hbs +++ b/thirdeye/thirdeye-frontend/app/pods/manage/yaml/template.hbs @@ -35,6 +35,8 @@ previewError=previewError previewErrorMsg=previewErrorMsg previewErrorInfo=previewErrorInfo + previewErrorScroll=previewErrorScroll + resetScroll=(action "resetErrorScroll") }} {{/detection-yaml}} diff --git a/thirdeye/thirdeye-frontend/app/pods/self-serve/create-alert/controller.js b/thirdeye/thirdeye-frontend/app/pods/self-serve/create-alert/controller.js index 2b32e01..c54849a 100644 --- a/thirdeye/thirdeye-frontend/app/pods/self-serve/create-alert/controller.js +++ b/thirdeye/thirdeye-frontend/app/pods/self-serve/create-alert/controller.js @@ -88,9 +88,11 @@ export default Controller.extend({ detectionError: false, detectionErrorMsg: null, detectionErrorInfo: null, + detectionErrorScroll: false, previewError: false, previewErrorMsg: null, previewErrorInfo: null, + previewErrorScroll: false, @@ -1081,11 +1083,22 @@ export default Controller.extend({ this.setProperties({ previewError: bubbledObject.previewError, previewErrorMsg: bubbledObject.previewErrorMsg, - previewErrorInfo: bubbledObject.previewErrorInfo + previewErrorInfo: bubbledObject.previewErrorInfo, + previewErrorScroll: bubbledObject.previewError }); }, /** + * set property value to false + * @method resetErrorScroll + * @param {string} propertyName - name of property to reset (ie 'detectionErrorScroll') + * @return {undefined} + */ + resetErrorScroll(propertyName) { + set(this, propertyName, false); + }, + + /** * update the subscription yaml string * @method updateSubscriptionYaml * @return {undefined} @@ -1135,7 +1148,8 @@ export default Controller.extend({ this.setProperties({ detectionError: true, detectionErrorMsg: result.message, - detectionErrorInfo: result["more-info"] + detectionErrorInfo: result["more-info"], + detectionErrorScroll: true }); } } @@ -1145,7 +1159,8 @@ export default Controller.extend({ this.setProperties({ detectionError: true, detectionErrorMsg: 'Create alert failed.', - detectionErrorInfo: error + detectionErrorInfo: error, + detectionErrorScroll: true }); }); }, diff --git a/thirdeye/thirdeye-frontend/app/pods/self-serve/create-alert/template.hbs b/thirdeye/thirdeye-frontend/app/pods/self-serve/create-alert/template.hbs index f5320d9..a8ac7b1 100644 --- a/thirdeye/thirdeye-frontend/app/pods/self-serve/create-alert/template.hbs +++ b/thirdeye/thirdeye-frontend/app/pods/self-serve/create-alert/template.hbs @@ -420,9 +420,12 @@ detectionError=detectionError detectionErrorMsg=detectionErrorMsg detectionErrorInfo=detectionErrorInfo + detectionErrorScroll=detectionErrorScroll previewError=previewError previewErrorMsg=previewErrorMsg previewErrorInfo=previewErrorInfo + previewErrorScroll=previewErrorScroll + resetScroll=(action "resetErrorScroll") }} {{/detection-yaml}} --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org