From 798b197d4aff51274254e64a98cc2c5ed9fa6ae7 Mon Sep 17 00:00:00 2001 From: Bruno Alves de Faria Date: Tue, 6 Feb 2018 16:26:36 -0200 Subject: [PATCH] Creating a generic UI error handling mechanism --- .../client/components/base/section/section.js | 4 +++ .../components/bootstrap/dialog/form.html | 18 ++++++++-- .../components/bootstrap/dialog/form.js | 7 ++++ .../components/bootstrap/dialog/header.html | 2 +- .../components/bootstrap/dialog/info.html | 2 +- .../components/bootstrap/dialog/info.js | 7 ++++ Packages/ohif-core/client/ui/handleError.js | 33 +++++++++++++++++++ Packages/ohif-core/client/ui/index.js | 1 + .../client/classes/HotkeysManager.js | 4 +-- .../radialProgressBar/radialProgressBar.styl | 3 +- .../client/components/longitudinal/index.js | 1 + .../longitudinalViewportOverlay.html | 4 +-- .../longitudinalViewportOverlay.styl | 4 +++ 13 files changed, 81 insertions(+), 9 deletions(-) create mode 100644 Packages/ohif-core/client/ui/handleError.js create mode 100644 Packages/ohif-measurements/client/components/longitudinal/longitudinalViewportOverlay/longitudinalViewportOverlay.styl diff --git a/Packages/ohif-core/client/components/base/section/section.js b/Packages/ohif-core/client/components/base/section/section.js index 1712983ba..b8f86af0f 100644 --- a/Packages/ohif-core/client/components/base/section/section.js +++ b/Packages/ohif-core/client/components/base/section/section.js @@ -55,3 +55,7 @@ Template.section.onCreated(() => { }); } }); + +Template.registerHelper('hasSection', sectionName => { + return !!OHIF.blaze.getSectionContent(Template.instance().view, sectionName); +}); diff --git a/Packages/ohif-core/client/components/bootstrap/dialog/form.html b/Packages/ohif-core/client/components/bootstrap/dialog/form.html index 40b039fd6..06d6715de 100644 --- a/Packages/ohif-core/client/components/bootstrap/dialog/form.html +++ b/Packages/ohif-core/client/components/bootstrap/dialog/form.html @@ -4,9 +4,23 @@ {{#form class=(concat 'modal-content ' this.formClass) hideValidationBox=true api=(extend instance.api instance.data.api) schema=this.schema }} - {{>dialogHeader this}} + {{#if or this.title (hasSection 'dialogHeader')}} + {{>dialogHeader this}} + {{/if}}