@@ -174,29 +174,34 @@ class DocIndex extends React.Component {
174174 * @return {* } a formated table cell for a given column
175175 */
176176 formatColumn ( column , cell , row ) {
177- const { t } = this . props ;
177+ const { t } = this . props ;
178178 let result = < td > { cell } </ td > ;
179179 switch ( column ) {
180180 case t ( 'File Name' , { ns : 'document_repository' } ) :
181181 let downloadURL = loris . BaseURL
182182 + '/document_repository/Files/'
183- + encodeURIComponent ( row [ t ( 'Uploaded By' , { ns : 'document_repository' } ) ] )
183+ + encodeURIComponent ( row [ t ( 'Uploaded By' ,
184+ { ns : 'document_repository' } ) ] )
184185 + '/'
185- + encodeURIComponent ( row [ t ( 'File Name' , { ns : 'document_repository' } ) ] ) ;
186+ + encodeURIComponent ( row [ t ( 'File Name' ,
187+ { ns : 'document_repository' } ) ] ) ;
186188 result = < td >
187189 < a
188190 href = { downloadURL }
189191 target = "_blank"
190- download = { encodeURIComponent ( row [ t ( 'File Name' , { ns : 'document_repository' } ) ] ) }
192+ download = { encodeURIComponent ( row [ t ( 'File Name' ,
193+ { ns : 'document_repository' } ) ] ) }
191194 >
192195 { cell }
193196 </ a >
194197 </ td > ;
195198 break ;
196199 case t ( 'Edit' , { ns : 'document_repository' } ) :
197200 let editURL = loris . BaseURL
198- + '/document_repository/edit/' + row [ t ( 'Edit' , { ns : 'document_repository' } ) ] ;
199- result = < td > < a href = { editURL } > { t ( 'Edit' , { ns : 'document_repository' } ) } </ a > </ td > ;
201+ + '/document_repository/edit/'
202+ + row [ t ( 'Edit' , { ns : 'document_repository' } ) ] ;
203+ result = < td > < a href = { editURL } > { t ( 'Edit' ,
204+ { ns : 'document_repository' } ) } </ a > </ td > ;
200205 break ;
201206 case t ( 'Delete File' , { ns : 'document_repository' } ) :
202207 let id = row [ t ( 'Edit' , { ns : 'document_repository' } ) ] ;
@@ -207,12 +212,14 @@ class DocIndex extends React.Component {
207212 function click ( ) {
208213 swal . fire ( {
209214 title : t ( 'Are you sure?' , { ns : 'document_repository' } ) ,
210- text : t ( 'You won\'t be able to revert this!' , { ns : 'document_repository' } ) ,
215+ text : t ( 'You won\'t be able to revert this!' ,
216+ { ns : 'document_repository' } ) ,
211217 type : 'warning' ,
212218 showCancelButton : true ,
213219 confirmButtonColor : '#3085d6' ,
214220 cancelButtonColor : '#d33' ,
215- confirmButtonText : t ( 'Yes, delete it!' , { ns : 'document_repository' } ) ,
221+ confirmButtonText : t ( 'Yes, delete it!' ,
222+ { ns : 'document_repository' } ) ,
216223 } ) . then ( ( result ) => {
217224 if ( result . value ) {
218225 let deleteurl = loris . BaseURL + '/document_repository/Files/' + id ;
@@ -223,14 +230,17 @@ class DocIndex extends React.Component {
223230 } ) . then ( ( resp ) => resp . json ( ) )
224231 . then ( ( ) => {
225232 location . reload ( ) ;
226- swal . fire ( t ( 'Delete Successful!' , { ns : 'document_repository' } ) , '' , 'success' ) ;
233+ swal . fire ( t ( 'Delete Successful!' ,
234+ { ns : 'document_repository' } ) , '' , 'success' ) ;
227235 } ) ;
228236 }
229237 } ) ;
230238 }
231239
232240 result = < td >
233- < a style = { { cursor : 'pointer' } } onClick = { click } > { t ( 'Delete' , { ns : 'document_repository' } ) } </ a >
241+ < a style = { { cursor : 'pointer' } } onClick = { click } >
242+ { t ( 'Delete' , { ns : 'document_repository' } ) }
243+ </ a >
234244 </ td > ;
235245 break ;
236246 }
@@ -243,11 +253,12 @@ class DocIndex extends React.Component {
243253 * @return {JSX } - React markup for the component
244254 */
245255 render ( ) {
246- const { t } = this . props ;
256+ const { t } = this . props ;
247257 // If error occurs, return a message.
248258 // XXX: Replace this with a UI component for 500 errors.
249259 if ( this . state . error ) {
250- return < h3 > { t ( 'An error occured while loading the page.' , { ns : 'document_repository' } ) } </ h3 > ;
260+ return < h3 > { t ( 'An error occured while loading the page.' ,
261+ { ns : 'document_repository' } ) } </ h3 > ;
251262 }
252263
253264 // Waiting for async data to load
@@ -258,34 +269,42 @@ class DocIndex extends React.Component {
258269 this . props . hasPermission ( 'document_repository_upload_edit' ) ;
259270 const options = this . state . data . fieldOptions ;
260271 const fields = [
261- { label : t ( 'File Name' , { ns : 'document_repository' } ) , show : true , filter : {
272+ { label : t ( 'File Name' ,
273+ { ns : 'document_repository' } ) , show : true , filter : {
262274 name : 'fileName' ,
263275 type : 'text' ,
264276 } } ,
265- { label : t ( 'Version' , { ns : 'document_repository' } ) , show : true , filter : {
277+ { label : t ( 'Version' ,
278+ { ns : 'document_repository' } ) , show : true , filter : {
266279 name : 'version' ,
267280 type : 'text' ,
268281 } } ,
269- { label : t ( 'File Type' , { ns : 'document_repository' } ) , show : true , filter : {
282+ { label : t ( 'File Type' ,
283+ { ns : 'document_repository' } ) , show : true , filter : {
270284 name : 'fileTypes' ,
271285 type : 'select' ,
272286 options : options . fileTypes ,
273287 } } ,
274- { label : t ( 'Instrument' , { ns : 'document_repository' } ) , show : false } ,
275- { label : t ( 'Uploaded By' , { ns : 'document_repository' } ) , show : true , filter : {
288+ { label : t ( 'Instrument' ,
289+ { ns : 'document_repository' } ) , show : false } ,
290+ { label : t ( 'Uploaded By' ,
291+ { ns : 'document_repository' } ) , show : true , filter : {
276292 name : 'uploadedBy' ,
277293 type : 'text' ,
278294 } } ,
279- { label : t ( 'For Site' , { ns : 'document_repository' } ) , show : true , filter : {
295+ { label : t ( 'For Site' ,
296+ { ns : 'document_repository' } ) , show : true , filter : {
280297 name : 'site' ,
281298 type : 'select' ,
282299 options : options . sites ,
283300 } } ,
284- { label : t ( 'Comments' , { ns : 'document_repository' } ) , show : true , filter : {
301+ { label : t ( 'Comments' ,
302+ { ns : 'document_repository' } ) , show : true , filter : {
285303 name : 'Comments' ,
286304 type : 'text' ,
287305 } } ,
288- { label : t ( 'Date Uploaded' , { ns : 'document_repository' } ) , show : true } ,
306+ { label : t ( 'Date Uploaded' ,
307+ { ns : 'document_repository' } ) , show : true } ,
289308 {
290309 label : t ( 'Edit' , { ns : 'document_repository' } ) ,
291310 show : this . props . hasPermission ( 'superUser' )
@@ -466,7 +485,8 @@ DocIndex.propTypes = {
466485window . addEventListener ( 'load' , ( ) => {
467486 i18n . addResourceBundle ( 'hi' , 'document_repository' , hiStrings ) ;
468487
469- const TranslatedDocIndex = withTranslation ( [ 'document_repository' , 'loris' ] ) ( DocIndex ) ;
488+ const TranslatedDocIndex = withTranslation (
489+ [ 'document_repository' , 'loris' ] ) ( DocIndex ) ;
470490
471491 createRoot (
472492 document . getElementById ( 'lorisworkspace' )
0 commit comments