authscape 1.0.284 → 1.0.286
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/index.js +10 -4
- package/package.json +1 -1
- package/src/components/DocumentManager.js +73 -66
package/index.js
CHANGED
|
@@ -460,7 +460,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
460
460
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
461
461
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
462
462
|
// remove before merging back
|
|
463
|
-
//
|
|
463
|
+
//import { FileUploader, apiService, NextImage } from 'authscape';
|
|
464
464
|
|
|
465
465
|
var DocumentManager = function DocumentManager(_ref) {
|
|
466
466
|
var loadedUser = _ref.loadedUser,
|
|
@@ -560,7 +560,9 @@ var DocumentManager = function DocumentManager(_ref) {
|
|
|
560
560
|
case 5:
|
|
561
561
|
folderResponse = _context.sent;
|
|
562
562
|
if (folderResponse != null && folderResponse.status == 200) {
|
|
563
|
+
setFolderParent(folderResponse.data);
|
|
563
564
|
setMasterFolder(folderResponse.data);
|
|
565
|
+
folderId = folderResponse.id;
|
|
564
566
|
}
|
|
565
567
|
_context.next = 10;
|
|
566
568
|
break;
|
|
@@ -589,7 +591,11 @@ var DocumentManager = function DocumentManager(_ref) {
|
|
|
589
591
|
case 18:
|
|
590
592
|
response = _context.sent;
|
|
591
593
|
if (response != null && response.status == 200) {
|
|
592
|
-
|
|
594
|
+
setIsLoading(true);
|
|
595
|
+
setTimeout(function () {
|
|
596
|
+
// setIsLoading(false);
|
|
597
|
+
setFiles(response.data);
|
|
598
|
+
}, 500);
|
|
593
599
|
}
|
|
594
600
|
_context.next = 26;
|
|
595
601
|
break;
|
|
@@ -845,7 +851,7 @@ var DocumentManager = function DocumentManager(_ref) {
|
|
|
845
851
|
height: "85vh",
|
|
846
852
|
width: '100%'
|
|
847
853
|
}
|
|
848
|
-
}, files != null && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, files.documentSegments.length > 0 && folderParent == null && files.documentSegments.map(function (segment, index) {
|
|
854
|
+
}, files != null && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, masterFolder == null && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, files.documentSegments.length > 0 && folderParent == null && files.documentSegments.map(function (segment, index) {
|
|
849
855
|
return /*#__PURE__*/_react["default"].createElement(_material.Box, {
|
|
850
856
|
sx: {
|
|
851
857
|
paddingTop: 3
|
|
@@ -929,7 +935,7 @@ var DocumentManager = function DocumentManager(_ref) {
|
|
|
929
935
|
}
|
|
930
936
|
}, file.lastUpdated)));
|
|
931
937
|
})), files != null && files.documentAndFiles != null && zeroStateView != null && /*#__PURE__*/_react["default"].createElement(_material.Box, null, zeroStateView(segment)));
|
|
932
|
-
}), (files.documentSegments.length == 0 || folderParent != null) && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
938
|
+
})), (files.documentSegments.length == 0 || folderParent != null) && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
933
939
|
container: true,
|
|
934
940
|
spacing: 2
|
|
935
941
|
}, files.documentAndFiles.map(function (file, index) {
|
package/package.json
CHANGED
|
@@ -22,7 +22,7 @@ import LockRoundedIcon from '@mui/icons-material/LockRounded';
|
|
|
22
22
|
import Tooltip from '@mui/material/Tooltip';
|
|
23
23
|
|
|
24
24
|
// remove before merging back
|
|
25
|
-
//
|
|
25
|
+
//import { FileUploader, apiService, NextImage } from 'authscape';
|
|
26
26
|
|
|
27
27
|
export const DocumentManager = ({loadedUser, setIsLoading, viewDocumentType = 1, disablePreview = false, openToFolderId = null, xs=12, sm=6, md=4, lg=2, overrideLockMessage = "The directory cannot be removed.", zeroStateView = null, fieldId1 = null, fieldId2 = null, fieldId3 = null}) => {
|
|
28
28
|
|
|
@@ -77,7 +77,9 @@ export const DocumentManager = ({loadedUser, setIsLoading, viewDocumentType = 1,
|
|
|
77
77
|
let folderResponse = await apiService().get("/Document/GetDocumentByFolderId?folderId=" + folderId);
|
|
78
78
|
if (folderResponse != null && folderResponse.status == 200)
|
|
79
79
|
{
|
|
80
|
-
|
|
80
|
+
setFolderParent(folderResponse.data);
|
|
81
|
+
setMasterFolder(folderResponse.data);
|
|
82
|
+
folderId = folderResponse.id;
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
else if (folderParent != null)
|
|
@@ -111,7 +113,11 @@ export const DocumentManager = ({loadedUser, setIsLoading, viewDocumentType = 1,
|
|
|
111
113
|
let response = await apiService().get("/Document/GetDocumentsAndFiles?parentFolderId=" + folderId + "&ViewDocumentType=" + viewDocumentType + params);
|
|
112
114
|
if (response != null && response.status == 200)
|
|
113
115
|
{
|
|
114
|
-
|
|
116
|
+
setIsLoading(true);
|
|
117
|
+
setTimeout(() => {
|
|
118
|
+
// setIsLoading(false);
|
|
119
|
+
setFiles(response.data);
|
|
120
|
+
}, 500);
|
|
115
121
|
}
|
|
116
122
|
}
|
|
117
123
|
else
|
|
@@ -308,7 +314,7 @@ export const DocumentManager = ({loadedUser, setIsLoading, viewDocumentType = 1,
|
|
|
308
314
|
}
|
|
309
315
|
|
|
310
316
|
<Divider />
|
|
311
|
-
|
|
317
|
+
|
|
312
318
|
<Breadcrumbs aria-label="breadcrumb" separator={">"} sx={{marginLeft:1, marginBottom:2, marginTop:2}}>
|
|
313
319
|
<Link underline="hover" color="inherit" sx={{cursor:"pointer", fontWeight:"bold"}} onClick={() => {
|
|
314
320
|
|
|
@@ -340,75 +346,76 @@ export const DocumentManager = ({loadedUser, setIsLoading, viewDocumentType = 1,
|
|
|
340
346
|
{files != null &&
|
|
341
347
|
<>
|
|
342
348
|
|
|
349
|
+
{masterFolder == null &&
|
|
350
|
+
<>
|
|
351
|
+
{(files.documentSegments.length > 0 && folderParent == null) && files.documentSegments.map((segment, index) => (
|
|
352
|
+
|
|
353
|
+
<Box sx={{paddingTop:3}}>
|
|
354
|
+
<Typography variant="h6" gutterBottom>
|
|
355
|
+
{segment.name}
|
|
356
|
+
</Typography>
|
|
343
357
|
|
|
344
|
-
|
|
345
|
-
{(files.documentSegments.length > 0 && folderParent == null) && files.documentSegments.map((segment, index) => (
|
|
346
|
-
|
|
347
|
-
<Box sx={{paddingTop:3}}>
|
|
348
|
-
<Typography variant="h6" gutterBottom>
|
|
349
|
-
{segment.name}
|
|
350
|
-
</Typography>
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
<Grid container spacing={2}>
|
|
354
|
-
{files.documentAndFiles.filter(item => item.segmentId == segment.id).map((file, index) => (
|
|
355
|
-
|
|
356
|
-
<Grid onContextMenu={(event) => {
|
|
357
|
-
handleContextMenu(event, file);
|
|
358
|
-
}} item key={index} xs={xs} sm={sm} md={md} lg={lg} onClick={() => handleFileClick(file)}>
|
|
359
|
-
<Paper
|
|
360
|
-
sx={{
|
|
361
|
-
padding: 2,
|
|
362
|
-
flexDirection: 'column',
|
|
363
|
-
height: "100%", display: "flex", alignItems: "center",
|
|
364
|
-
cursor: 'pointer',
|
|
365
|
-
maxHeight:300,
|
|
366
|
-
position:"relative",
|
|
367
|
-
'&:hover': {
|
|
368
|
-
backgroundColor: '#F5F5F5'
|
|
369
|
-
}
|
|
370
|
-
}}>
|
|
371
|
-
|
|
372
|
-
{file.type === 'folder' &&
|
|
373
|
-
<Box sx={{position:"absolute", top:45, color:"white"}}>
|
|
374
|
-
{file.count}
|
|
375
|
-
</Box>}
|
|
376
|
-
|
|
377
|
-
{file.isLocked &&
|
|
378
|
-
<Box sx={{position:"absolute", top:10, right: 10, color:"black"}}>
|
|
379
|
-
<Tooltip title={overrideLockMessage}>
|
|
380
|
-
<LockRoundedIcon />
|
|
381
|
-
</Tooltip>
|
|
382
|
-
</Box>
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
{file.type === 'folder' ? (
|
|
386
|
-
<FolderIcon sx={{ fontSize: 80, color:"orange" }} />
|
|
387
|
-
) : (
|
|
388
358
|
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
359
|
+
<Grid container spacing={2}>
|
|
360
|
+
{files.documentAndFiles.filter(item => item.segmentId == segment.id).map((file, index) => (
|
|
361
|
+
|
|
362
|
+
<Grid onContextMenu={(event) => {
|
|
363
|
+
handleContextMenu(event, file);
|
|
364
|
+
}} item key={index} xs={xs} sm={sm} md={md} lg={lg} onClick={() => handleFileClick(file)}>
|
|
365
|
+
<Paper
|
|
366
|
+
sx={{
|
|
367
|
+
padding: 2,
|
|
368
|
+
flexDirection: 'column',
|
|
369
|
+
height: "100%", display: "flex", alignItems: "center",
|
|
370
|
+
cursor: 'pointer',
|
|
371
|
+
maxHeight:300,
|
|
372
|
+
position:"relative",
|
|
373
|
+
'&:hover': {
|
|
374
|
+
backgroundColor: '#F5F5F5'
|
|
375
|
+
}
|
|
376
|
+
}}>
|
|
377
|
+
|
|
378
|
+
{file.type === 'folder' &&
|
|
379
|
+
<Box sx={{position:"absolute", top:45, color:"white"}}>
|
|
380
|
+
{file.count}
|
|
381
|
+
</Box>}
|
|
382
|
+
|
|
383
|
+
{file.isLocked &&
|
|
384
|
+
<Box sx={{position:"absolute", top:10, right: 10, color:"black"}}>
|
|
385
|
+
<Tooltip title={overrideLockMessage}>
|
|
386
|
+
<LockRoundedIcon />
|
|
387
|
+
</Tooltip>
|
|
388
|
+
</Box>
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
{file.type === 'folder' ? (
|
|
392
|
+
<FolderIcon sx={{ fontSize: 80, color:"orange" }} />
|
|
393
|
+
) : (
|
|
394
|
+
|
|
395
|
+
file.documentFileExtentionType == 0 || disablePreview ? <InsertDriveFileOutlinedIcon sx={{ fontSize: 60 }} /> : <NextImage src={file.uri} alt={"Image"} width={80} height={80} />
|
|
396
|
+
|
|
397
|
+
)}
|
|
398
|
+
<Typography variant="subtitle1" sx={{paddingTop:1, fontSize:14}}>{file.name}</Typography>
|
|
399
|
+
<Typography variant="subtitle2" sx={{paddingTop:0, fontSize:11}}>{file.lastUpdated}</Typography>
|
|
400
|
+
</Paper>
|
|
401
|
+
</Grid>
|
|
402
|
+
|
|
403
|
+
))}
|
|
404
|
+
</Grid>
|
|
396
405
|
|
|
397
|
-
))}
|
|
398
|
-
</Grid>
|
|
399
406
|
|
|
407
|
+
{(files != null && files.documentAndFiles != null && zeroStateView != null) &&
|
|
408
|
+
|
|
409
|
+
<Box>
|
|
410
|
+
{zeroStateView(segment)}
|
|
411
|
+
</Box>
|
|
412
|
+
}
|
|
400
413
|
|
|
401
|
-
{(files != null && files.documentAndFiles != null && zeroStateView != null) &&
|
|
402
|
-
|
|
403
|
-
<Box>
|
|
404
|
-
{zeroStateView(segment)}
|
|
405
414
|
</Box>
|
|
406
|
-
}
|
|
407
415
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
416
|
+
))}
|
|
417
|
+
</>
|
|
418
|
+
}
|
|
412
419
|
|
|
413
420
|
{(files.documentSegments.length == 0 || folderParent != null) &&
|
|
414
421
|
<>
|