authscape 1.0.496 → 1.0.498
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
CHANGED
|
@@ -4415,7 +4415,10 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
4415
4415
|
|
|
4416
4416
|
function FileMapping(_ref) {
|
|
4417
4417
|
var currentUser = _ref.currentUser,
|
|
4418
|
-
|
|
4418
|
+
_ref$hideDocumentMana = _ref.hideDocumentManager,
|
|
4419
|
+
hideDocumentManager = _ref$hideDocumentMana === void 0 ? false : _ref$hideDocumentMana,
|
|
4420
|
+
_ref$documentTypeId = _ref.documentTypeId,
|
|
4421
|
+
documentTypeId = _ref$documentTypeId === void 0 ? null : _ref$documentTypeId,
|
|
4419
4422
|
_ref$onOpened = _ref.onOpened,
|
|
4420
4423
|
onOpened = _ref$onOpened === void 0 ? null : _ref$onOpened,
|
|
4421
4424
|
_ref$onPublished = _ref.onPublished,
|
|
@@ -4436,6 +4439,7 @@ function FileMapping(_ref) {
|
|
|
4436
4439
|
}
|
|
4437
4440
|
}, [documentComponentId]);
|
|
4438
4441
|
return /*#__PURE__*/_react["default"].createElement(_system.Box, null, documentComponentId == null && /*#__PURE__*/_react["default"].createElement(ManageMappingDocuments, {
|
|
4442
|
+
documentTypeId: documentTypeId,
|
|
4439
4443
|
hideDocumentManager: hideDocumentManager,
|
|
4440
4444
|
companyId: currentUser != null ? currentUser.companyId : null,
|
|
4441
4445
|
onManageField: function onManageField(documentComponentId) {
|
|
@@ -4505,6 +4509,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import
|
|
|
4505
4509
|
function ManageMappingDocuments(_ref) {
|
|
4506
4510
|
var _ref$hideDocumentMana = _ref.hideDocumentManager,
|
|
4507
4511
|
hideDocumentManager = _ref$hideDocumentMana === void 0 ? false : _ref$hideDocumentMana,
|
|
4512
|
+
_ref$documentTypeId = _ref.documentTypeId,
|
|
4513
|
+
documentTypeId = _ref$documentTypeId === void 0 ? null : _ref$documentTypeId,
|
|
4508
4514
|
_ref$companyId = _ref.companyId,
|
|
4509
4515
|
companyId = _ref$companyId === void 0 ? null : _ref$companyId,
|
|
4510
4516
|
_ref$locationId = _ref.locationId,
|
|
@@ -4718,7 +4724,7 @@ function ManageMappingDocuments(_ref) {
|
|
|
4718
4724
|
}
|
|
4719
4725
|
}, [document]);
|
|
4720
4726
|
(0, _react.useEffect)(function () {
|
|
4721
|
-
if (showAddNewDocument) {
|
|
4727
|
+
if (showAddNewDocument && documentTypeId == null) {
|
|
4722
4728
|
// get all document types
|
|
4723
4729
|
var fetchData = /*#__PURE__*/function () {
|
|
4724
4730
|
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
@@ -4745,7 +4751,7 @@ function ManageMappingDocuments(_ref) {
|
|
|
4745
4751
|
}();
|
|
4746
4752
|
fetchData();
|
|
4747
4753
|
}
|
|
4748
|
-
}, [showAddNewDocument]);
|
|
4754
|
+
}, [showAddNewDocument, documentTypeId]);
|
|
4749
4755
|
var GetHeaderRowData = /*#__PURE__*/function () {
|
|
4750
4756
|
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(documentComponentId) {
|
|
4751
4757
|
var response;
|
|
@@ -4849,7 +4855,7 @@ function ManageMappingDocuments(_ref) {
|
|
|
4849
4855
|
sx: {
|
|
4850
4856
|
paddingBottom: 2
|
|
4851
4857
|
}
|
|
4852
|
-
}, "Please select the type of document, then click \"Choose a file\""), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4858
|
+
}, "Please select the type of document, then click \"Choose a file\""), documentType == null && /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4853
4859
|
sx: {
|
|
4854
4860
|
marginTop: 2
|
|
4855
4861
|
}
|
|
@@ -4887,7 +4893,7 @@ function ManageMappingDocuments(_ref) {
|
|
|
4887
4893
|
}, /*#__PURE__*/_react["default"].createElement(FileUploader, {
|
|
4888
4894
|
refOveride: fileUploaderRef,
|
|
4889
4895
|
params: {
|
|
4890
|
-
documentTypeId: selectedDocument.id,
|
|
4896
|
+
documentTypeId: documentTypeId == null ? selectedDocument.id : documentTypeId,
|
|
4891
4897
|
companyId: companyId
|
|
4892
4898
|
},
|
|
4893
4899
|
url: "/DocumentMapping/SyncDocument",
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import { Box } from '@mui/system';
|
|
|
3
3
|
// import ManageMappingDocuments from './manageMappingDocuments';
|
|
4
4
|
// import AssignMapping from './AssignMapping';
|
|
5
5
|
|
|
6
|
-
export function FileMapping({currentUser, hideDocumentManager, onOpened = null, onPublished = null, onCanceled = null, onArchived = null}) {
|
|
6
|
+
export function FileMapping({currentUser, hideDocumentManager = false, documentTypeId = null, onOpened = null, onPublished = null, onCanceled = null, onArchived = null}) {
|
|
7
7
|
|
|
8
8
|
const [documentComponentId, setDocumentComponentId] = useState(null);
|
|
9
9
|
|
|
@@ -22,7 +22,8 @@ export function FileMapping({currentUser, hideDocumentManager, onOpened = null,
|
|
|
22
22
|
return (
|
|
23
23
|
<Box>
|
|
24
24
|
{documentComponentId == null &&
|
|
25
|
-
<ManageMappingDocuments
|
|
25
|
+
<ManageMappingDocuments
|
|
26
|
+
documentTypeId={documentTypeId}
|
|
26
27
|
hideDocumentManager={hideDocumentManager}
|
|
27
28
|
companyId={currentUser != null ? currentUser.companyId : null}
|
|
28
29
|
onManageField={(documentComponentId) => {
|
|
@@ -19,7 +19,7 @@ import PublishRoundedIcon from '@mui/icons-material/PublishRounded';
|
|
|
19
19
|
import Grid from '@mui/material/Grid';
|
|
20
20
|
import DownloadRoundedIcon from '@mui/icons-material/DownloadRounded';
|
|
21
21
|
|
|
22
|
-
export function ManageMappingDocuments({hideDocumentManager = false, companyId = null, locationId = null, userId = null, onManageField = null, onArchive = null}) {
|
|
22
|
+
export function ManageMappingDocuments({hideDocumentManager = false, documentTypeId = null, companyId = null, locationId = null, userId = null, onManageField = null, onArchive = null}) {
|
|
23
23
|
|
|
24
24
|
const [document, setDocument] = useState(null);
|
|
25
25
|
const [addColumnDialog, setAddColumnDialog] = useState(false);
|
|
@@ -164,7 +164,7 @@ export function ManageMappingDocuments({hideDocumentManager = false, companyId =
|
|
|
164
164
|
|
|
165
165
|
useEffect(() => {
|
|
166
166
|
|
|
167
|
-
if (showAddNewDocument)
|
|
167
|
+
if (showAddNewDocument && documentTypeId == null)
|
|
168
168
|
{
|
|
169
169
|
// get all document types
|
|
170
170
|
const fetchData = async () => {
|
|
@@ -177,7 +177,7 @@ export function ManageMappingDocuments({hideDocumentManager = false, companyId =
|
|
|
177
177
|
fetchData();
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
}, [showAddNewDocument])
|
|
180
|
+
}, [showAddNewDocument, documentTypeId])
|
|
181
181
|
|
|
182
182
|
const GetHeaderRowData = async (documentComponentId) => {
|
|
183
183
|
|
|
@@ -282,37 +282,39 @@ export function ManageMappingDocuments({hideDocumentManager = false, companyId =
|
|
|
282
282
|
Please select the type of document, then click "Choose a file"
|
|
283
283
|
</DialogContentText>
|
|
284
284
|
|
|
285
|
-
|
|
286
|
-
<Box sx={{
|
|
287
|
-
<
|
|
288
|
-
<
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
285
|
+
{documentType == null &&
|
|
286
|
+
<Box sx={{marginTop:2}}>
|
|
287
|
+
<Box sx={{ minWidth: 120 }}>
|
|
288
|
+
<FormControl fullWidth>
|
|
289
|
+
<InputLabel id="demo-simple-select-label">Document Type</InputLabel>
|
|
290
|
+
<Select
|
|
291
|
+
labelId="demo-simple-select-label"
|
|
292
|
+
id="demo-simple-select"
|
|
293
|
+
inputRef={refSelectDocumentType}
|
|
294
|
+
onChange={(val) => {
|
|
295
|
+
|
|
296
|
+
var _selectedDocument = componentTypes.find(s => s.id == val.target.value);
|
|
297
|
+
setSelectedDocument(_selectedDocument);
|
|
298
|
+
|
|
299
|
+
}}
|
|
300
|
+
label="DocumentType">
|
|
301
|
+
|
|
302
|
+
{componentTypes != null && componentTypes.map((componentType) => {
|
|
303
|
+
return (<MenuItem value={componentType.id}>{componentType.name}</MenuItem>)
|
|
304
|
+
})}
|
|
305
|
+
|
|
306
|
+
</Select>
|
|
307
|
+
</FormControl>
|
|
308
|
+
</Box>
|
|
307
309
|
</Box>
|
|
308
|
-
|
|
310
|
+
}
|
|
309
311
|
|
|
310
312
|
{(selectedDocument != null) &&
|
|
311
313
|
|
|
312
314
|
<Box sx={{textAlign:"center", width:"100%", display:"flex", alignItems:"center", paddingTop:2}}>
|
|
313
315
|
<FileUploader refOveride={fileUploaderRef} params={{
|
|
314
316
|
|
|
315
|
-
documentTypeId: selectedDocument.id,
|
|
317
|
+
documentTypeId: documentTypeId == null ? selectedDocument.id : documentTypeId,
|
|
316
318
|
companyId: companyId
|
|
317
319
|
|
|
318
320
|
}} url={"/DocumentMapping/SyncDocument"} multiple={true} variant='custom' onUploadCompleted={(responses) => {
|