From 4fbe7908a8d12234582180848db8eb2a972933d6 Mon Sep 17 00:00:00 2001
From: Xiao Gui <xgui3783@gmail.com>
Date: Thu, 14 Feb 2019 14:22:33 +0100
Subject: [PATCH] feat: show displayName and minor tweaks for pluginDev

---
 src/atlasViewer/atlasViewer.dataService.service.ts   | 5 ++++-
 src/atlasViewer/atlasViewer.pluginService.service.ts | 3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/atlasViewer/atlasViewer.dataService.service.ts b/src/atlasViewer/atlasViewer.dataService.service.ts
index 34362e294..07f5a9e2f 100644
--- a/src/atlasViewer/atlasViewer.dataService.service.ts
+++ b/src/atlasViewer/atlasViewer.dataService.service.ts
@@ -13,6 +13,9 @@ export class AtlasViewerDataService implements OnDestroy{
   
   private subscriptions : Subscription[] = []
 
+  /**
+   * TODO ensure 
+   */
   public promiseFetchedPluginManifests : Promise<PluginManifest[]> = new Promise((resolve,reject)=>{
     Promise.all([
       PLUGINDEV
@@ -25,7 +28,7 @@ export class AtlasViewerDataService implements OnDestroy{
       )
         .then(arr => arr.reduce((acc,curr) => acc.concat(curr) ,[]))
     ])
-      .then(arr => resolve( [ ... arr[0], ... arr[1] ] ))
+      .then(arr => resolve( [].concat(arr[0]).concat(arr[1]) ))
       .catch(reject)
   })
   
diff --git a/src/atlasViewer/atlasViewer.pluginService.service.ts b/src/atlasViewer/atlasViewer.pluginService.service.ts
index 363a86130..390fd9156 100644
--- a/src/atlasViewer/atlasViewer.pluginService.service.ts
+++ b/src/atlasViewer/atlasViewer.pluginService.service.ts
@@ -107,7 +107,7 @@ export class PluginServices{
         const widgetCompRef = this.widgetService.addNewWidget(pluginUnit,{
           state : 'floating',
           exitable : true,
-          title : plugin.name
+          title : plugin.displayName || plugin.name
         })
 
         const unsubscribeOnPluginDestroy = []
@@ -171,6 +171,7 @@ export class PluginHandler{
 
 export interface PluginManifest{
   name? : string
+  displayName? : string
   templateURL? : string
   template? : string
   scriptURL? : string
-- 
GitLab