@@ -100,24 +100,27 @@ qx.Class.define("osparc.announcement.AnnouncementUIFactory", {
100100 } ,
101101
102102 hasLoginAnnouncement : function ( ) {
103- const announcement = this . getAnnouncement ( ) ;
104- return this . self ( ) . isValid ( announcement , "login" ) ;
103+ return this . __announcements && this . __announcements . some ( announcement => this . self ( ) . isValid ( announcement , "login" ) ) ;
105104 } ,
106105
107106 __hasRibbonAnnouncement : function ( ) {
108- const announcement = this . getAnnouncement ( ) ;
109- return this . self ( ) . isValid ( announcement , "ribbon" ) ;
107+ return this . __announcements && this . __announcements . some ( announcement => this . self ( ) . isValid ( announcement , "ribbon" ) ) ;
110108 } ,
111109
112110 hasUserMenuAnnouncement : function ( ) {
113- const announcement = this . getAnnouncement ( ) ;
114- return this . self ( ) . isValid ( announcement , "user-menu" ) && announcement . getLink ( ) ;
111+ return this . __announcements && this . __announcements . some ( announcement => this . self ( ) . isValid ( announcement , "ribbon" ) && announcement . getLink ( ) ) ;
115112 } ,
116113
117- createLoginAnnouncement : function ( ) {
118- const announcement = this . getAnnouncement ( ) ;
119- const loginAnnouncement = this . self ( ) . createLoginAnnouncement ( announcement . getTitle ( ) , announcement . getDescription ( ) ) ;
120- return loginAnnouncement ;
114+ createLoginAnnouncements : function ( ) {
115+ const loginAnnouncements = [ ] ;
116+ this . __announcements . forEach ( announcement => {
117+ if ( this . self ( ) . isValid ( announcement , "login" ) ) {
118+ loginAnnouncements . push ( this . self ( ) . createLoginAnnouncement ( announcement . getTitle ( ) , announcement . getDescription ( ) ) ) ;
119+ }
120+ } ) ;
121+ const layout = new qx . ui . container . Composite ( new qx . ui . layout . VBox ( 10 ) ) ;
122+ loginAnnouncements . forEach ( loginAnnouncement => layout . add ( loginAnnouncement ) ) ;
123+ return layout ;
121124 } ,
122125
123126 __addRibbonAnnouncement : function ( ) {
0 commit comments