2121 */ 
2222
2323qx . Class . define ( "osparc.dashboard.FileButtonItem" ,  { 
24-   extend : osparc . dashboard . FileButtonBase , 
24+   extend : osparc . dashboard . ListButtonBase , 
2525
2626  /** 
2727    * @param  file {osparc.data.model.File} The file to display 
@@ -52,42 +52,18 @@ qx.Class.define("osparc.dashboard.FileButtonItem", {
5252      init : null , 
5353      apply : "__applyFile" , 
5454    } , 
55- 
56-     title : { 
57-       check : "String" , 
58-       nullable : true , 
59-       apply : "__applyTitle" , 
60-     } , 
61- 
62-     modifiedAt : { 
63-       check : "Date" , 
64-       nullable : true , 
65-       apply : "__applyModifiedAt" , 
66-     } , 
6755  } , 
6856
6957  members : { 
7058    _createChildControlImpl : function ( id )  { 
7159      let  control ; 
7260      switch  ( id )  { 
73-         case  "icon" : { 
74-           control  =  new  osparc . dashboard . FolderWithSharedIcon ( ) . set ( { 
75-             anonymous : true , 
76-             height : 40 , 
77-             padding : 5 
78-           } ) ; 
79-           this . _add ( control ,  osparc . dashboard . FolderButtonBase . POS . ICON ) ; 
80-           break ; 
81-         } 
82-         case  "title" :
83-           control  =  new  qx . ui . basic . Label ( ) . set ( { 
84-             font : "text-14" , 
85-           } ) ; 
86-           this . _add ( control ,  osparc . dashboard . FolderButtonBase . POS . TITLE ) ; 
87-           break ; 
8861        case  "date-by" :
8962          control  =  new  osparc . ui . basic . DateAndBy ( ) ; 
90-           this . _add ( control ,  osparc . dashboard . FolderButtonBase . POS . SUBTITLE ) ; 
63+           this . _add ( control ,  { 
64+             row : 0 , 
65+             column : osparc . dashboard . ListButtonBase . POS . LAST_CHANGE 
66+           } ) ; 
9167          break ; 
9268        case  "menu-button" : { 
9369          control  =  new  qx . ui . form . MenuButton ( ) . set ( { 
@@ -102,8 +78,10 @@ qx.Class.define("osparc.dashboard.FileButtonItem", {
10278          control . getContentElement ( ) . setStyles ( { 
10379            "border-radius" : `${ osparc . dashboard . ListButtonItem . MENU_BTN_DIMENSIONS  /  2 }  
10480          } ) ; 
105-           osparc . utils . Utils . setIdToWidget ( control ,  "folderItemMenuButton" ) ; 
106-           this . _add ( control ,  osparc . dashboard . FolderButtonBase . POS . MENU ) ; 
81+           this . _add ( control ,  { 
82+             row : 0 , 
83+             column : osparc . dashboard . ListButtonBase . POS . OPTIONS 
84+           } ) ; 
10785          break ; 
10886        } 
10987      } 
@@ -112,37 +90,30 @@ qx.Class.define("osparc.dashboard.FileButtonItem", {
11290
11391    __applyFile : function ( file )  { 
11492      const  id  =  file . getPath ( ) ; 
115-       this . getChildControl ( "icon" ) ; 
11693      this . set ( { 
11794        cardKey : "file-"  +  id , 
11895      } ) ; 
119-       file . bind ( "name" ,  this ,  "title" ) ; 
120-       file . bind ( "modifiedAt" ,  this ,  "modifiedAt" ) ; 
121- 
12296      osparc . utils . Utils . setIdToWidget ( this ,  "fileItem_"  +  id ) ; 
12397
124-       this . __addMenuButton ( ) ; 
125-     } , 
98+       const  icon  =  this . getChildControl ( "icon" ) ; 
99+       if  ( file . getIsDirectory ( ) )  { 
100+         icon . setSource ( "@FontAwesome5Solid/folder/24" ) ; 
101+       }  else  { 
102+         icon . setSource ( "@FontAwesome5Solid/file/24" ) ; 
103+       } 
126104
127-     __applyTitle : function ( value )  { 
128105      const  label  =  this . getChildControl ( "title" ) ; 
129106      label . set ( { 
130-         value, 
131-         toolTipText : value , 
107+         value :  file . getName ( ) , 
108+         toolTipText : file . getName ( ) , 
132109      } ) ; 
133-     } , 
134110
135-     __applyModifiedAt : function ( value )  { 
136-       if  ( value )  { 
137-         const  dateBy  =  this . getChildControl ( "date-by" ) ; 
138-         dateBy . set ( { 
139-           date : value , 
140-           toolTipText : this . tr ( "Last modified" ) , 
141-         } ) 
142-       } 
143-     } , 
111+       const  dateBy  =  this . getChildControl ( "date-by" ) ; 
112+       dateBy . set ( { 
113+         date : file . getModifiedAt ( ) , 
114+         toolTipText : this . tr ( "Last modified" ) , 
115+       } ) ; 
144116
145-     __addMenuButton : function ( )  { 
146117      const  menuButton  =  this . getChildControl ( "menu-button" ) ; 
147118      menuButton . setVisibility ( "visible" ) ; 
148119
0 commit comments