@campxdev/shared 2.0.28 → 2.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/shared",
3
- "version": "2.0.28",
3
+ "version": "2.0.30",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -8,7 +8,7 @@ import {
8
8
  } from '@mui/material'
9
9
  import { SxProps } from '@mui/system'
10
10
  import _ from 'lodash'
11
- import { useEffect, useState } from 'react'
11
+ import { ReactNode, useEffect, useState } from 'react'
12
12
  import Spinner from '../../Spinner'
13
13
  import NoRecordsFound from '../common/NoRecordsFound'
14
14
  import { SortAscIcon, SortDescIcon, SortIcon } from '../common/icons'
@@ -212,7 +212,11 @@ export default function Table({
212
212
  return onRowClick && onRowClick(row)
213
213
  }}
214
214
  >
215
- <> {showTotal && calculateTotal(row)}</>
215
+ <>
216
+ {' '}
217
+ {showTotal &&
218
+ (calculateTotal(row) as unknown as ReactNode)}
219
+ </>
216
220
  {columns.map((col, colIndex) => (
217
221
  <StyledTableCell
218
222
  key={colIndex}
@@ -226,11 +230,17 @@ export default function Table({
226
230
  {col?.dataType && col?.dataType == 'currency' ? (
227
231
  <>{convertToAmount(row[col.dataIndex])}</>
228
232
  ) : (
229
- <>
230
- {col?.render
231
- ? col.render(row[col.dataIndex], row, rowIndex)
232
- : _.get(row, col.dataIndex)}
233
- </>
233
+ ((
234
+ <>
235
+ {col?.render
236
+ ? col.render(
237
+ row[col.dataIndex],
238
+ row,
239
+ rowIndex,
240
+ )
241
+ : _.get(row, col.dataIndex)}
242
+ </>
243
+ ) as ReactNode)
234
244
  )}
235
245
  </StyledTableCell>
236
246
  ))}
@@ -239,27 +249,30 @@ export default function Table({
239
249
 
240
250
  {showTotal && (
241
251
  <StyledTableRow canRowClick={false}>
242
- {columns.map((col, colIndex) => {
243
- return (
244
- <>
245
- <StyledTableCell
246
- key={colIndex}
247
- columnsLength={columns.length}
248
- columnIndex={colIndex + 1}
249
- rowIndex={dataSource.length + 1}
250
- col={col}
251
- isBodyCell
252
- sx={sx}
253
- >
254
- {col?.dataType && col?.dataType == 'currency' ? (
255
- <>{convertToAmount(totalCount[colIndex])}</>
256
- ) : (
257
- <>{totalCount[colIndex]}</>
258
- )}
259
- </StyledTableCell>
260
- </>
261
- )
262
- })}
252
+ {
253
+ columns.map((col, colIndex) => {
254
+ return (
255
+ <>
256
+ <StyledTableCell
257
+ key={colIndex}
258
+ columnsLength={columns.length}
259
+ columnIndex={colIndex + 1}
260
+ rowIndex={dataSource.length + 1}
261
+ col={col}
262
+ isBodyCell
263
+ sx={sx}
264
+ >
265
+ {col?.dataType &&
266
+ col?.dataType == 'currency' ? (
267
+ <>{convertToAmount(totalCount[colIndex])}</>
268
+ ) : (
269
+ <>{totalCount[colIndex]}</>
270
+ )}
271
+ </StyledTableCell>
272
+ </>
273
+ )
274
+ }) as ReactNode
275
+ }
263
276
  </StyledTableRow>
264
277
  )}
265
278
  </TableBody>
@@ -8,7 +8,7 @@ import {
8
8
  } from '@mui/material'
9
9
  import { SxProps } from '@mui/system'
10
10
  import _ from 'lodash'
11
- import { useEffect, useState } from 'react'
11
+ import { ReactNode, useEffect, useState } from 'react'
12
12
  import Spinner from '../../Spinner'
13
13
  import NoRecordsFound from '../common/NoRecordsFound'
14
14
  import { SortAscIcon, SortDescIcon, SortIcon } from '../common/icons'
@@ -207,7 +207,11 @@ export default function Table<T>({
207
207
  {rowIndex + 1}
208
208
  </StyledTableCell>
209
209
  )}
210
- <> {showTotal && calculateTotal(row)}</>
210
+ <>
211
+ {' '}
212
+ {showTotal &&
213
+ (calculateTotal(row) as unknown as ReactNode)}
214
+ </>
211
215
  {columns.map((col, colIndex) => (
212
216
  <StyledTableCell
213
217
  key={colIndex}
@@ -225,11 +229,17 @@ export default function Table<T>({
225
229
  )}
226
230
  </>
227
231
  ) : (
228
- <>
229
- {col?.render
230
- ? col.render(row[col.dataIndex], row, rowIndex)
231
- : _.get(row, col.dataIndex)}
232
- </>
232
+ ((
233
+ <>
234
+ {col?.render
235
+ ? col.render(
236
+ row[col.dataIndex],
237
+ row,
238
+ rowIndex,
239
+ )
240
+ : _.get(row, col.dataIndex)}
241
+ </>
242
+ ) as ReactNode)
233
243
  )}
234
244
  </StyledTableCell>
235
245
  ))}
@@ -247,6 +247,7 @@ export enum Permission {
247
247
  CAN_EVALUATORS_ADD = 'can_evaluators_add',
248
248
  CAN_EVALUATORS_EDIT = 'can_evaluators_edi',
249
249
  CAN_EVALUATORS_DELETE = 'can_evaluators_delete',
250
+ CAN_EVALUATORS_DOWNLOAD = 'can_evaluators_download',
250
251
 
251
252
  // Rooms
252
253
  CAN_EXAM_ROOM_VIEW = 'can_exam_rooms_view',
@@ -746,6 +747,7 @@ export interface IPermissions {
746
747
  can_evaluators_add: boolean
747
748
  can_evaluators_edit: boolean
748
749
  can_evaluators_delete: boolean
750
+ can_evaluators_download: boolean
749
751
  can_grades_view: boolean
750
752
  can_grades_add: boolean
751
753
  can_grades_edit: boolean