@@ -26,7 +26,6 @@ qx.Class.define("osparc.dashboard.ResourceFilter", {
26
26
27
27
this . __resourceType = resourceType ;
28
28
this . __sharedWithButtons = [ ] ;
29
- this . __workspaceButtons = [ ] ;
30
29
this . __tagButtons = [ ] ;
31
30
this . __serviceTypeButtons = [ ] ;
32
31
@@ -42,11 +41,8 @@ qx.Class.define("osparc.dashboard.ResourceFilter", {
42
41
43
42
members : {
44
43
__resourceType : null ,
45
- __contextLayout : null ,
46
- __contextRadioGroup : null ,
47
44
__workspacesAndFoldersTree : null ,
48
45
__sharedWithButtons : null ,
49
- __workspaceButtons : null ,
50
46
__tagButtons : null ,
51
47
__serviceTypeButtons : null ,
52
48
@@ -88,10 +84,10 @@ qx.Class.define("osparc.dashboard.ResourceFilter", {
88
84
89
85
/* SHARED WITH */
90
86
__createSharedWithFilterLayout : function ( ) {
91
- const layout = this . __contextLayout = new qx . ui . container . Composite ( new qx . ui . layout . VBox ( 5 ) ) ;
87
+ const sharedWithLayout = new qx . ui . container . Composite ( new qx . ui . layout . VBox ( 5 ) ) ;
92
88
93
- const radioGroup = this . __contextRadioGroup = new qx . ui . form . RadioGroup ( ) ;
94
- radioGroup . setAllowEmptySelection ( false ) ;
89
+ const sharedWithRadioGroup = new qx . ui . form . RadioGroup ( ) ;
90
+ sharedWithRadioGroup . setAllowEmptySelection ( false ) ;
95
91
96
92
const options = osparc . dashboard . SearchBarFilter . getSharedWithOptions ( this . __resourceType ) ;
97
93
options . forEach ( option => {
@@ -124,8 +120,8 @@ qx.Class.define("osparc.dashboard.ResourceFilter", {
124
120
}
125
121
button . id = option . id ;
126
122
127
- layout . add ( button ) ;
128
- radioGroup . add ( button ) ;
123
+ sharedWithLayout . add ( button ) ;
124
+ sharedWithRadioGroup . add ( button ) ;
129
125
130
126
button . addListener ( "execute" , ( ) => {
131
127
this . fireDataEvent ( "changeSharedWith" , {
@@ -137,61 +133,13 @@ qx.Class.define("osparc.dashboard.ResourceFilter", {
137
133
this . __sharedWithButtons . push ( button ) ;
138
134
} ) ;
139
135
140
- return layout ;
136
+ return sharedWithLayout ;
141
137
} ,
142
138
/* /SHARED WITH */
143
139
144
140
/* WORKSPACES */
145
- __addWorkspaceButtons : function ( ) {
146
- this . __contextLayout . add ( new qx . ui . core . Spacer ( ) ) ;
147
- const workspacesButton = new qx . ui . toolbar . RadioButton ( this . tr ( "Shared Workspaces" ) , osparc . store . Workspaces . iconPath ( 22 ) ) ;
148
- workspacesButton . workspaceId = - 1 ;
149
- workspacesButton . set ( {
150
- appearance : "filter-toggle-button"
151
- } ) ;
152
- this . __contextLayout . add ( workspacesButton ) ;
153
- this . __contextRadioGroup . add ( workspacesButton ) ;
154
- workspacesButton . addListener ( "execute" , ( ) => {
155
- this . fireDataEvent ( "changeWorkspace" , workspacesButton . workspaceId ) ;
156
- } ) ;
157
-
158
- this . reloadWorkspaceButtons ( ) ;
159
- } ,
160
-
161
- reloadWorkspaceButtons : function ( ) {
162
- // remove first the workspaces
163
- for ( let i = this . __workspaceButtons . length - 1 ; i >= 0 ; i -- ) {
164
- const workspaceButton = this . __workspaceButtons [ i ] ;
165
- this . __contextLayout . remove ( workspaceButton ) ;
166
- this . __contextRadioGroup . remove ( workspaceButton ) ;
167
- }
168
- this . __workspaceButtons = [ ] ;
169
- osparc . store . Workspaces . fetchWorkspaces ( )
170
- . then ( workspaces => {
171
- workspaces . forEach ( workspace => {
172
- const workspaceButton = new qx . ui . toolbar . RadioButton ( null , osparc . store . Workspaces . iconPath ( 22 ) ) ;
173
- workspace . bind ( "name" , workspaceButton , "label" ) ;
174
- workspaceButton . workspaceId = workspace . getWorkspaceId ( ) ;
175
- this . __workspaceButtons . push ( workspaceButton ) ;
176
- workspaceButton . set ( {
177
- appearance : "filter-toggle-button" ,
178
- marginLeft : 15 ,
179
- } ) ;
180
- this . __contextLayout . add ( workspaceButton ) ;
181
- this . __contextRadioGroup . add ( workspaceButton ) ;
182
- workspaceButton . addListener ( "execute" , ( ) => {
183
- this . fireDataEvent ( "changeWorkspace" , workspaceButton . workspaceId ) ;
184
- } , this ) ;
185
- } ) ;
186
- } )
187
- . catch ( console . error ) ;
188
- } ,
189
-
190
141
workspaceSelected : function ( workspaceId ) {
191
- const foundButton = this . __workspaceButtons . find ( workspaceButton => workspaceButton . workspaceId === workspaceId ) ;
192
- if ( foundButton ) {
193
- foundButton . execute ( ) ;
194
- }
142
+ // OM: select folder
195
143
} ,
196
144
/* /WORKSPACES */
197
145
0 commit comments