11import React , { useCallback , useContext , useEffect , useState } from 'react' ;
2- import { ColumnActionsMode , CommandBar , CommandBarButton , ContextualMenu , DirectionalHint , getTheme , IColumn , ICommandBarItemProps , IContextualMenuItem , IContextualMenuProps , Label , Persona , PersonaSize , SelectionMode , ShimmeredDetailsList , Stack } from '@fluentui/react' ;
2+ import { ColumnActionsMode , CommandBar , CommandBarButton , ContextualMenu , DirectionalHint , getTheme , IColumn , ICommandBarItemProps , Icon , IContextualMenuItem , IContextualMenuProps , Persona , PersonaSize , SelectionMode , ShimmeredDetailsList , Stack } from '@fluentui/react' ;
33import { HttpMethod , useAuthApiCall } from '../../../hooks/useAuthApiCall' ;
44import { ApiEndpoint } from '../../../models/apiEndpoints' ;
55import { WorkspaceContext } from '../../../contexts/WorkspaceContext' ;
@@ -13,6 +13,7 @@ import { ExceptionLayout } from '../ExceptionLayout';
1313import { AirlockNewRequest } from './AirlockNewRequest' ;
1414import { WorkspaceRoleName } from '../../../models/roleNames' ;
1515import { useAccount , useMsal } from '@azure/msal-react' ;
16+ import { getFileTypeIconProps } from '@fluentui/react-file-type-icons' ;
1617
1718export const Airlock : React . FunctionComponent = ( ) => {
1819 const [ airlockRequests , setAirlockRequests ] = useState ( [ ] as AirlockRequest [ ] ) ;
@@ -27,7 +28,7 @@ export const Airlock: React.FunctionComponent = () => {
2728 const apiCall = useAuthApiCall ( ) ;
2829 const theme = getTheme ( ) ;
2930 const navigate = useNavigate ( ) ;
30- const { instance , accounts } = useMsal ( ) ;
31+ const { accounts } = useMsal ( ) ;
3132 const account = useAccount ( accounts [ 0 ] || { } ) ;
3233
3334 // Get the airlock request data from API
@@ -151,15 +152,31 @@ export const Airlock: React.FunctionComponent = () => {
151152
152153 const columns : IColumn [ ] = [
153154 {
154- key : 'avatar ' ,
155- name : '' ,
155+ key : 'fileIcon ' ,
156+ name : 'fileIcon ' ,
156157 minWidth : 16 ,
157158 maxWidth : 16 ,
158159 isIconOnly : true ,
159160 onRender : ( request : AirlockRequest ) => {
160- return < Persona size = { PersonaSize . size24 } text = { request . user ?. name } />
161+ if ( request . status === AirlockRequestStatus . Draft ) {
162+ return < Icon iconName = "FolderOpen" style = { { verticalAlign :'bottom' , fontSize : 14 } } />
163+ } else if ( request . files ?. length > 0 && request . files [ 0 ] . name ) {
164+ const fileType = request . files [ 0 ] . name . split ( '.' ) . pop ( ) ;
165+ return < Icon { ...getFileTypeIconProps ( { extension : fileType } ) } style = { { verticalAlign :'bottom' } } />
166+ } else {
167+ return < Icon iconName = "Page" style = { { verticalAlign :'bottom' , fontSize : 14 } } />
168+ }
161169 }
162170 } ,
171+ {
172+ key : 'title' ,
173+ name : 'Title' ,
174+ ariaLabel : 'Title of the airlock request' ,
175+ minWidth : 150 ,
176+ maxWidth : 300 ,
177+ isResizable : true ,
178+ fieldName : 'requestTitle'
179+ } ,
163180 {
164181 key : 'creator_user_id' ,
165182 name : 'Initiator' ,
@@ -168,7 +185,7 @@ export const Airlock: React.FunctionComponent = () => {
168185 maxWidth : 200 ,
169186 isResizable : true ,
170187 fieldName : 'initiator' ,
171- onRender : ( request : AirlockRequest ) => request . user ?. name ,
188+ onRender : ( request : AirlockRequest ) => < Persona size = { PersonaSize . size24 } text = { request . user ?. name } /> ,
172189 isFiltered : filters . has ( 'creator_user_id' )
173190 } ,
174191 {
@@ -310,7 +327,7 @@ export const Airlock: React.FunctionComponent = () => {
310327 selectionMode = { SelectionMode . none }
311328 getKey = { ( item ) => item ?. id }
312329 onItemInvoked = { ( item ) => navigate ( item . id ) }
313- className = "tre-table-rows-align-centre "
330+ className = "tre-table"
314331 enableShimmer = { loadingState === LoadingState . Loading }
315332 />
316333 {
0 commit comments