@@ -143,47 +143,47 @@ const KaTableComponent: React.FC<CustomTableProps> = ({
143143 } else if ( tableTitle === 'submitted' ) {
144144 content . contentType === 'Course'
145145 ? router . push ( {
146- pathname : `/course-hierarchy/${ identifier } ` ,
147- query : { identifier, isReadOnly : true , previousPage : 'submitted' } ,
148- } )
146+ pathname : `/course-hierarchy/${ identifier } ` ,
147+ query : { identifier, isReadOnly : true , previousPage : 'submitted' } ,
148+ } )
149149 : router . push ( {
150- pathname : `/workspace/content/review` ,
151- query : { identifier } ,
152- } ) ;
150+ pathname : `/workspace/content/review` ,
151+ query : { identifier } ,
152+ } ) ;
153153 } else if ( tableTitle === 'all-content' && mode === 'review' ) {
154154 content . contentType === 'Course'
155155 ? router . push ( {
156- pathname : `/course-hierarchy/${ identifier } ` ,
157- query : {
158- identifier,
159- isReadOnly : true ,
160- previousPage : 'allContents' ,
161- } ,
162- } )
156+ pathname : `/course-hierarchy/${ identifier } ` ,
157+ query : {
158+ identifier,
159+ isReadOnly : true ,
160+ previousPage : 'allContents' ,
161+ } ,
162+ } )
163163 : router . push ( {
164- pathname : `/workspace/content/review` ,
165- query : { identifier, isReadOnly : true , isAllContents : true } ,
166- } ) ;
164+ pathname : `/workspace/content/review` ,
165+ query : { identifier, isReadOnly : true , isAllContents : true } ,
166+ } ) ;
167167 } else if ( tableTitle === 'discover-contents' ) {
168168 content . contentType === 'Course'
169169 ? router . push ( {
170- pathname : `/course-hierarchy/${ identifier } ` ,
171- query : { identifier, previousPage : 'discover-contents' } ,
172- } )
170+ pathname : `/course-hierarchy/${ identifier } ` ,
171+ query : { identifier, previousPage : 'discover-contents' } ,
172+ } )
173173 : router . push ( {
174- pathname : `/workspace/content/review` ,
175- query : { identifier, isDiscoverContent : true } ,
176- } ) ;
174+ pathname : `/workspace/content/review` ,
175+ query : { identifier, isDiscoverContent : true } ,
176+ } ) ;
177177 } else if ( tableTitle === 'content-library' ) {
178178 content . contentType === 'Course'
179179 ? router . push ( {
180- pathname : `/course-hierarchy/${ identifier } ` ,
181- query : { identifier, previousPage : 'content-library' } ,
182- } )
180+ pathname : `/course-hierarchy/${ identifier } ` ,
181+ query : { identifier, previousPage : 'content-library' } ,
182+ } )
183183 : router . push ( {
184- pathname : `/workspace/content/review` ,
185- query : { identifier, isContentLibrary : true } ,
186- } ) ;
184+ pathname : `/workspace/content/review` ,
185+ query : { identifier, isContentLibrary : true } ,
186+ } ) ;
187187 } else if (
188188 content ?. mimeType &&
189189 MIME_TYPE . GENERIC_MIME_TYPE . includes ( content ?. mimeType )
@@ -211,14 +211,14 @@ const KaTableComponent: React.FC<CustomTableProps> = ({
211211 columns = {
212212 selectable
213213 ? [
214- {
215- key : '__select__' ,
216- title : '' ,
217- dataType : DataType . Boolean ,
218- style : { width : 40 } ,
219- } ,
220- ...columns ,
221- ]
214+ {
215+ key : '__select__' ,
216+ title : '' ,
217+ dataType : DataType . Boolean ,
218+ style : { width : 40 } ,
219+ } ,
220+ ...columns ,
221+ ]
222222 : columns
223223 }
224224 data = { data }
@@ -227,25 +227,25 @@ const KaTableComponent: React.FC<CustomTableProps> = ({
227227 childComponents = { {
228228 cell : selectable
229229 ? {
230- content : ( props ) => {
231- if ( props . column . key === '__select__' ) {
232- return (
233- < Checkbox
234- checked = { selected . includes ( props . rowData . identifier ) }
235- disabled = {
236- ! selected . includes ( props . rowData . identifier ) &&
237- selected . length >= 3
238- }
239- onChange = { ( ) =>
240- onSelect && onSelect ( props . rowData . identifier )
241- }
242- size = "small"
243- />
244- ) ;
245- }
246- return undefined ;
247- } ,
248- }
230+ content : ( props ) => {
231+ if ( props . column . key === '__select__' ) {
232+ return (
233+ < Checkbox
234+ checked = { selected . includes ( props . rowData . identifier ) }
235+ disabled = {
236+ ! selected . includes ( props . rowData . identifier ) &&
237+ selected . length >= 3
238+ }
239+ onChange = { ( ) =>
240+ onSelect && onSelect ( props . rowData . identifier )
241+ }
242+ size = "small"
243+ />
244+ ) ;
245+ }
246+ return undefined ;
247+ } ,
248+ }
249249 : undefined ,
250250 cellText : {
251251 content : ( props ) => {
@@ -269,9 +269,21 @@ const KaTableComponent: React.FC<CustomTableProps> = ({
269269 style = { {
270270 display : 'flex' ,
271271 alignItems : 'center' ,
272- cursor : selectable ? 'default' : 'pointer' ,
272+ cursor : selectable
273+ ? 'default'
274+ : props ?. rowData ?. aiStatus === 'FAILED'
275+ ? 'not-allowed'
276+ : 'pointer' ,
277+ } }
278+ onClick = { ( ) => {
279+ if ( props ?. rowData ?. aiStatus === 'FAILED' ) {
280+ window . alert (
281+ 'The AI Assessment you are trying to create has been failed. Please try creating a new assessment.'
282+ ) ;
283+ } else {
284+ ! selectable && openEditor ( props . rowData ) ;
285+ }
273286 } }
274- onClick = { ( ) => ! selectable && openEditor ( props . rowData ) }
275287 >
276288 < Grid container alignItems = "center" spacing = { 1 } >
277289 < Grid item xs = { 3 } md = { 3 } lg = { 3 } xl = { 2 } >
0 commit comments