changeset 1958:142c7ee8fe1f

added configuration options: ShowInfoPanelAtStartup, ShowUserPreferencesButton, and ShowNotForDiagnosticUsageDisclaimer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 27 Oct 2022 14:53:09 +0200
parents 3f88c239043a
children 889892e51545
files Applications/StoneWebViewer/NEWS Applications/StoneWebViewer/NOTES.txt Applications/StoneWebViewer/WebApplication/app.js Applications/StoneWebViewer/WebApplication/configuration.json Applications/StoneWebViewer/WebApplication/index.html
diffstat 5 files changed, 69 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/StoneWebViewer/NEWS	Thu Oct 27 12:06:04 2022 +0200
+++ b/Applications/StoneWebViewer/NEWS	Thu Oct 27 14:53:09 2022 +0200
@@ -1,6 +1,10 @@
 Pending changes in the mainline
 ===============================
 
+* New configuration options:
+  - "ShowInfoPanelAtStartup" to control the info panel at startup
+  - "ShowUserPreferencesButton" to show the button for setting preferences
+  - "ShowNotForDiagnosticUsageDisclaimer" to show disclaimer about diagnostic usage
 * More tolerance wrt. bad values of the Pixel Spacing (0028,0030) tag
 * Support of DICOM images without the Study Date (0008,0020) tag
 
--- a/Applications/StoneWebViewer/NOTES.txt	Thu Oct 27 12:06:04 2022 +0200
+++ b/Applications/StoneWebViewer/NOTES.txt	Thu Oct 27 14:53:09 2022 +0200
@@ -92,6 +92,22 @@
   displayed at the startup.
 
 
+Minor changes
+-------------
+
+- Option "ShowInfoPanelButtonEnabled" in the Osimis Web viewer is
+  named "ShowUserPreferencesButton" in the Stone Web viewer.
+
+- Option "AlwaysShowNotForDiagnosticUsageDisclaimer" in the Osimis Web
+  viewer is named "ShowNotForDiagnosticUsageDisclaimer" in the Stone
+  Web viewer.
+
+- The allowed values for option "ShowInfoPanelAtStartup" are "Always",
+  "Never" of "User" (note the first character in upper case). In the
+  Osimis Web viewer, these options were in lower case.
+
+
+
 Authorization to the DICOMweb server (new in 2.0)
 ====================================
 
--- a/Applications/StoneWebViewer/WebApplication/app.js	Thu Oct 27 12:06:04 2022 +0200
+++ b/Applications/StoneWebViewer/WebApplication/app.js	Thu Oct 27 14:53:09 2022 +0200
@@ -1115,8 +1115,6 @@
     if (localStorage.settingSoftwareRendering) {
       this.settingSoftwareRendering = (localStorage.settingSoftwareRendering == '1');
     }
-    
-    this.modalNotDiagnostic = this.settingNotDiagnostic;
 
     var that = this;
     
@@ -1162,10 +1160,19 @@
     stone.SetSkipSeriesFromModalities(JSON.stringify(app.globalConfiguration.SkipSeriesFromModalities));
   }
   
+  if (app.globalConfiguration.ShowInfoPanelAtStartup == 'Always') {
+    app.modalNotDiagnostic = true;
+  } else if (app.globalConfiguration.ShowInfoPanelAtStartup == 'Never') {
+    app.modalNotDiagnostic = false;
+  } else if (app.globalConfiguration.ShowInfoPanelAtStartup == 'User') {
+    app.modalNotDiagnostic = app.settingNotDiagnostic;
+  } else {
+    alert('Bad value for option "ShowInfoPanelAtStartup": ' + app.globalConfiguration.ShowInfoPanelAtStartup);
+  }
+
   // Bearer token is new in Stone Web viewer 2.0
   var token = getParameterFromUrl('token');
-  if (token !== undefined)
-  {
+  if (token !== undefined) {
     stone.AddHttpHeader('Authorization', 'Bearer ' + token);
   }
   
--- a/Applications/StoneWebViewer/WebApplication/configuration.json	Thu Oct 27 12:06:04 2022 +0200
+++ b/Applications/StoneWebViewer/WebApplication/configuration.json	Thu Oct 27 14:53:09 2022 +0200
@@ -119,6 +119,26 @@
     /**
      * Define a list of modality type that the viewer will ignore.
      **/
-    "SkipSeriesFromModalities": ["SR", "SEG", "PR"]
+    "SkipSeriesFromModalities": ["SR", "SEG", "PR"],
+
+    /**
+     * Whether to display the info panel at startup. Allowed values:
+     * "Always", "Never", "User". With "User", the user can decide to
+     * show or not the info panel in the user preferences panel (this
+     * is implemented using a cookie). (New in Stone Web viewer 2.4)
+     **/
+    "ShowInfoPanelAtStartup": "User",
+
+    /**
+     * Whether to give access to the user preferences window. (New in
+     * Stone Web viewer 2.4)
+     **/
+    "ShowUserPreferencesButton" : true,
+
+    /**
+     * Display a "not for diagnostic usage" disclaimer above the list
+     * of studies/series. (New in Stone Web viewer 2.4)
+     **/
+    "ShowNotForDiagnosticUsageDisclaimer": true
   }
 }
--- a/Applications/StoneWebViewer/WebApplication/index.html	Thu Oct 27 12:06:04 2022 +0200
+++ b/Applications/StoneWebViewer/WebApplication/index.html	Thu Oct 27 14:53:09 2022 +0200
@@ -40,11 +40,14 @@
             </p>
           </div>
           <div class="wvInfoPopupForm">
+            <div v-if="globalConfiguration.ShowInfoPanelAtStartup == 'User'">
+              <br>
+              <label>Show this information at startup
+                <input type="checkbox" style="margin-left: 20px" v-model="settingNotDiagnostic">
+              </label>
+              <br>
+            </div>
             <br>
-            <label>Show this information at startup
-              <input type="checkbox" style="margin-left: 20px" v-model="settingNotDiagnostic">
-            </label>
-            <br><br>
             <div style="text-align: center;">
               <button class="wvInfoPopupCloseButton" @click="modalNotDiagnostic = false">
                 Close
@@ -76,10 +79,12 @@
             <h3>User preferences</h3>
           </div>
           <div class="wvInfoPopupForm">
-            <label>Warn about the intended use at startup
-              <input type="checkbox" style="margin-left: 20px" v-model="settingNotDiagnostic">
-            </label>
-            <br>
+            <div v-if="globalConfiguration.ShowInfoPanelAtStartup == 'User'">
+              <label>Warn about the intended use at startup
+                <input type="checkbox" style="margin-left: 20px" v-model="settingNotDiagnostic">
+              </label>
+              <br>
+            </div>
             <label>Use software rendering (will reload the viewer)
               <input type="checkbox" style="margin-left: 20px" v-model="settingSoftwareRendering">
             </label>
@@ -172,7 +177,9 @@
                 <i class="fa fa-th"></i>
               </div>
 
-              <!--p class="clear disclaimer mbn">For patients, teachers and researchers.</p-->
+              <p v-if="globalConfiguration.ShowNotForDiagnosticUsageDisclaimer" class="clear disclaimer mbn">
+                For patients, researchers and quality assurance. Not for diagnostic usage.
+              </p>
             </div>        
             <div class="wvLayoutLeft__contentMiddle">
 
@@ -572,7 +579,7 @@
               </button>
             </div>
 
-            <div class="ng-scope inline-object">
+            <div class="ng-scope inline-object" v-if="globalConfiguration.ShowUserPreferencesButton">
               <button class="wvButton--underline text-center"
                       data-toggle="tooltip" data-title="User preferences"
                       v-on:click="modalPreferences = true">