@@ -89,7 +89,7 @@ qx.Class.define("osparc.desktop.organizations.OrganizationsList", {
8989 getOrgModel : function ( orgId ) {
9090 let org = null ;
9191 this . __orgsModel . forEach ( orgModel => {
92- if ( orgModel . getGroupId ( ) === parseInt ( orgId ) ) {
92+ if ( "getGroupId" in orgModel && orgModel . getGroupId ( ) === parseInt ( orgId ) ) {
9393 org = orgModel ;
9494 }
9595 } ) ;
@@ -146,6 +146,10 @@ qx.Class.define("osparc.desktop.organizations.OrganizationsList", {
146146 ctrl . bindProperty ( "description" , "subtitle" , null , item , id ) ;
147147 ctrl . bindProperty ( "groupMembers" , "groupMembers" , null , item , id ) ;
148148 ctrl . bindProperty ( "accessRights" , "accessRights" , null , item , id ) ;
149+ // handle separator
150+ ctrl . bindProperty ( "isSeparator" , "enabled" , {
151+ converter : val => ! val // disable clicks on separator
152+ } , item , id ) ;
149153 } ,
150154 configureItem : item => {
151155 item . subscribeToFilterGroup ( "organizationsList" ) ;
@@ -165,6 +169,15 @@ qx.Class.define("osparc.desktop.organizations.OrganizationsList", {
165169 const orgKey = e . getData ( ) ;
166170 this . __deleteOrganization ( orgKey ) ;
167171 } ) ;
172+ item . addListener ( "changeEnabled" , e => {
173+ if ( ! e . getData ( ) ) {
174+ item . set ( {
175+ minHeight : 1 ,
176+ maxHeight : 1 ,
177+ decorator : "separator-strong" ,
178+ } ) ;
179+ }
180+ } ) ;
168181 }
169182 } ) ;
170183
@@ -189,7 +202,28 @@ qx.Class.define("osparc.desktop.organizations.OrganizationsList", {
189202 const groupsStore = osparc . store . Groups . getInstance ( ) ;
190203 const orgs = Object . values ( groupsStore . getOrganizations ( ) ) ;
191204 orgs . sort ( this . self ( ) . sortOrganizations ) ;
192- orgs . forEach ( org => orgsModel . append ( org ) ) ;
205+
206+ // insert a separator between product and non-product groups
207+ const productGroup = [
208+ osparc . store . Groups . COLLAB_TYPE . EVERYONE ,
209+ osparc . store . Groups . COLLAB_TYPE . SUPPORT ,
210+ ] ;
211+ const hasProductGroup = orgs . some ( org => productGroup . includes ( org . getGroupType ( ) ) ) ;
212+ const hasNonProductGroup = orgs . some ( org => ! productGroup . includes ( org . getGroupType ( ) ) ) ;
213+ let separatorInserted = false ;
214+ orgs . forEach ( org => {
215+ const isProductGroup = productGroup . includes ( org . getGroupType ( ) ) ;
216+ // Only insert separator if both sides exist
217+ if ( ! isProductGroup && hasProductGroup && hasNonProductGroup && ! separatorInserted ) {
218+ const separator = {
219+ isSeparator : true
220+ } ;
221+ orgsModel . append ( qx . data . marshal . Json . createModel ( separator ) ) ;
222+ separatorInserted = true ;
223+ }
224+ orgsModel . append ( org ) ;
225+ } ) ;
226+
193227 this . setOrganizationsLoaded ( true ) ;
194228 if ( orgId ) {
195229 this . fireDataEvent ( "organizationSelected" , orgId ) ;
0 commit comments