authscape 1.0.634 → 1.0.638
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 +3738 -385
- package/package.json +1 -1
- package/src/components/AuthScapeApp.js +14 -5
- package/src/components/dropzone.js +0 -1
- package/src/components/mapping/assignMapping.js +237 -0
- package/src/components/mapping/conditionBasedTool.js +99 -0
- package/src/components/mapping/datasources.js +259 -0
- package/src/components/mapping/fileMapping.js +72 -0
- package/src/components/mapping/manageMappingDocuments.js +525 -0
- package/src/components/mapping/mappedColumn.js +70 -0
- package/src/components/mapping/matchExisting.js +135 -0
- package/src/components/mapping/newMappingColumn.js +132 -0
- package/src/components/mapping/sortableColumn.js +33 -0
- package/src/components/mapping/uploadMappedFile.js +124 -0
- package/src/components/privateLabel/AddDomainModal.js +404 -0
- package/src/components/privateLabel/privateLabelEditor.js +483 -0
- package/src/services/PrivateLabelPageModule.js +12 -2
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import React, {useEffect, useState, useRef} from 'react';
|
|
2
|
+
// import {apiService, authService, StripeConnect, ReactDraft, EditableDatagrid, FileUploader} from 'authscape';
|
|
3
|
+
import Button from '@mui/material/Button';
|
|
4
|
+
import { Box } from '@mui/system';
|
|
5
|
+
import LinkRoundedIcon from '@mui/icons-material/LinkRounded';
|
|
6
|
+
import Dialog from '@mui/material/Dialog';
|
|
7
|
+
import DialogActions from '@mui/material/DialogActions';
|
|
8
|
+
import DialogContent from '@mui/material/DialogContent';
|
|
9
|
+
import DialogContentText from '@mui/material/DialogContentText';
|
|
10
|
+
import DialogTitle from '@mui/material/DialogTitle';
|
|
11
|
+
import TextField from '@mui/material/TextField';
|
|
12
|
+
import InputLabel from '@mui/material/InputLabel';
|
|
13
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
14
|
+
import FormControl from '@mui/material/FormControl';
|
|
15
|
+
import Select from '@mui/material/Select';
|
|
16
|
+
import Checkbox from '@mui/material/Checkbox';
|
|
17
|
+
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
18
|
+
|
|
19
|
+
export function MatchExistingMappedColumn({companyId, documentId, documentMappingId, fromName, toOptions, onResponse}) {
|
|
20
|
+
|
|
21
|
+
const [createNewOpen, setCreateNewOpen] = useState(false);
|
|
22
|
+
|
|
23
|
+
const [onlyAddRowIfFound, setOnlyAddRowIfFound] = useState(false);
|
|
24
|
+
const [rememberForNextTime, setRememberForNextTime] = useState(true);
|
|
25
|
+
|
|
26
|
+
const [selectedToColumn, setSelectedToColumn] = useState(null);
|
|
27
|
+
|
|
28
|
+
const handleClose = () => {
|
|
29
|
+
setCreateNewOpen(false);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const checkboxRememberLabel = { inputProps: { 'aria-label': 'Checkbox Remember' } };
|
|
33
|
+
|
|
34
|
+
const SelectedExistingColumns = ({toOptions}) => {
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<Box sx={{ minWidth: 120 }}>
|
|
38
|
+
<FormControl fullWidth>
|
|
39
|
+
<InputLabel id="demo-simple-select-label">Match to column</InputLabel>
|
|
40
|
+
<Select
|
|
41
|
+
labelId="demo-simple-select-label"
|
|
42
|
+
id="demo-simple-select"
|
|
43
|
+
value={selectedToColumn}
|
|
44
|
+
label="Age"
|
|
45
|
+
onChange={(event) => {
|
|
46
|
+
setSelectedToColumn(event.target.value);
|
|
47
|
+
}}>
|
|
48
|
+
{toOptions != null && toOptions.map((toOption) => {
|
|
49
|
+
|
|
50
|
+
let isRequiredMessage = "";
|
|
51
|
+
if (toOption.isRequired)
|
|
52
|
+
{
|
|
53
|
+
isRequiredMessage = " (Required)";
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<MenuItem value={toOption.name}>{toOption.visibleName} {isRequiredMessage}</MenuItem>
|
|
58
|
+
);
|
|
59
|
+
})}
|
|
60
|
+
</Select>
|
|
61
|
+
</FormControl>
|
|
62
|
+
</Box>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<Box>
|
|
69
|
+
<Dialog
|
|
70
|
+
open={createNewOpen}
|
|
71
|
+
onClose={handleClose}
|
|
72
|
+
fullWidth={true}
|
|
73
|
+
aria-labelledby="alert-dialog-title"
|
|
74
|
+
aria-describedby="alert-dialog-description">
|
|
75
|
+
<DialogTitle id="alert-dialog-title">
|
|
76
|
+
{"Match existing column"}
|
|
77
|
+
</DialogTitle>
|
|
78
|
+
<DialogContent>
|
|
79
|
+
<DialogContentText id="alert-dialog-description">
|
|
80
|
+
***Inform the user about what it means to match existing columns***
|
|
81
|
+
</DialogContentText>
|
|
82
|
+
<Box sx={{paddingTop:2}}>
|
|
83
|
+
<TextField id="outlined-basic" label="File Column Name" defaultValue={fromName} variant="outlined" disabled={true} fullWidth={true} />
|
|
84
|
+
</Box>
|
|
85
|
+
<Box sx={{paddingTop:2}}>
|
|
86
|
+
<SelectedExistingColumns toOptions={toOptions} />
|
|
87
|
+
</Box>
|
|
88
|
+
|
|
89
|
+
<Box sx={{paddingTop:2}}>
|
|
90
|
+
|
|
91
|
+
<FormControlLabel
|
|
92
|
+
value="end"
|
|
93
|
+
control={
|
|
94
|
+
<Checkbox {...checkboxRememberLabel} defaultChecked onChange={(event) => {
|
|
95
|
+
setRememberForNextTime(event.target.checked);
|
|
96
|
+
}} />
|
|
97
|
+
}
|
|
98
|
+
label="Remember match for next time"
|
|
99
|
+
labelPlacement="end"
|
|
100
|
+
/>
|
|
101
|
+
|
|
102
|
+
</Box>
|
|
103
|
+
|
|
104
|
+
</DialogContent>
|
|
105
|
+
<DialogActions>
|
|
106
|
+
<Button onClick={handleClose}>Cancel</Button>
|
|
107
|
+
<Button onClick={async () => {
|
|
108
|
+
|
|
109
|
+
let response = await apiService().put("/DocumentMapping/AssignMapping", {
|
|
110
|
+
companyId: companyId,
|
|
111
|
+
documentId: documentId,
|
|
112
|
+
fileColumnName: fromName,
|
|
113
|
+
documentMappingId: documentMappingId,
|
|
114
|
+
matchedColumn: selectedToColumn,
|
|
115
|
+
onlyAddRowIfColumnFound: onlyAddRowIfFound,
|
|
116
|
+
rememberForNextTime: rememberForNextTime
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
if (response != null && response.status == 200)
|
|
120
|
+
{
|
|
121
|
+
onResponse();
|
|
122
|
+
handleClose();
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
}} autoFocus>
|
|
126
|
+
Match Existing
|
|
127
|
+
</Button>
|
|
128
|
+
</DialogActions>
|
|
129
|
+
</Dialog>
|
|
130
|
+
<Button startIcon={<LinkRoundedIcon />} size="small" sx={{paddingLeft:3}} onClick={() => {
|
|
131
|
+
setCreateNewOpen(true);
|
|
132
|
+
}}>Match Existing</Button>
|
|
133
|
+
</Box>
|
|
134
|
+
);
|
|
135
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import React, {useState, useRef} from 'react';
|
|
2
|
+
import Card from '@mui/material/Card';
|
|
3
|
+
import CardContent from '@mui/material/CardContent';
|
|
4
|
+
import Button from '@mui/material/Button';
|
|
5
|
+
import { Box } from '@mui/system';
|
|
6
|
+
import Typography from '@mui/material/Typography';
|
|
7
|
+
import AddRoundedIcon from '@mui/icons-material/AddRounded';
|
|
8
|
+
import LinkRoundedIcon from '@mui/icons-material/LinkRounded';
|
|
9
|
+
import Dialog from '@mui/material/Dialog';
|
|
10
|
+
import DialogActions from '@mui/material/DialogActions';
|
|
11
|
+
import DialogContent from '@mui/material/DialogContent';
|
|
12
|
+
import DialogContentText from '@mui/material/DialogContentText';
|
|
13
|
+
import DialogTitle from '@mui/material/DialogTitle';
|
|
14
|
+
import TextField from '@mui/material/TextField';
|
|
15
|
+
import Grid from '@mui/material/Grid';
|
|
16
|
+
import LocalParkingRoundedIcon from '@mui/icons-material/LocalParkingRounded';
|
|
17
|
+
import TextFieldsRoundedIcon from '@mui/icons-material/TextFieldsRounded';
|
|
18
|
+
import IntegrationInstructionsRoundedIcon from '@mui/icons-material/IntegrationInstructionsRounded';
|
|
19
|
+
import ListAltRoundedIcon from '@mui/icons-material/ListAltRounded';
|
|
20
|
+
import CalendarMonthRoundedIcon from '@mui/icons-material/CalendarMonthRounded';
|
|
21
|
+
import CheckBoxRoundedIcon from '@mui/icons-material/CheckBoxRounded';
|
|
22
|
+
import InsertPhotoRoundedIcon from '@mui/icons-material/InsertPhotoRounded';
|
|
23
|
+
// import { apiService } from 'authscape';
|
|
24
|
+
|
|
25
|
+
export function NewMappingColumn({name, companyId, documentType, documentId, documentMappingId, onResponse}) {
|
|
26
|
+
|
|
27
|
+
const newColumnNameRef = useRef(null);
|
|
28
|
+
const newColumnDescriptionRef = useRef(null);
|
|
29
|
+
|
|
30
|
+
const [createNewOpen, setCreateNewOpen] = useState(false);
|
|
31
|
+
const [selectedAttributeId, setSelectedAttributeId] = useState(null);
|
|
32
|
+
|
|
33
|
+
const handleClose = () => {
|
|
34
|
+
setCreateNewOpen(false);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const AttributeTypeComponent = ({id, icon, text}) => {
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<Grid item xs={3}>
|
|
41
|
+
<Card sx={{textAlign:"center", cursor:"pointer", backgroundColor: (selectedAttributeId == id ? "#e5e5e5": "none")}} onClick={() => {
|
|
42
|
+
setSelectedAttributeId(id);
|
|
43
|
+
}}>
|
|
44
|
+
<CardContent>
|
|
45
|
+
{icon}
|
|
46
|
+
<Typography variant="body2" color="text.secondary" sx={{paddingTop:1}}>
|
|
47
|
+
{text}
|
|
48
|
+
</Typography>
|
|
49
|
+
</CardContent>
|
|
50
|
+
</Card>
|
|
51
|
+
</Grid>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<Box>
|
|
57
|
+
<Dialog
|
|
58
|
+
open={createNewOpen}
|
|
59
|
+
onClose={handleClose}
|
|
60
|
+
fullWidth={true}
|
|
61
|
+
aria-labelledby="alert-dialog-title"
|
|
62
|
+
aria-describedby="alert-dialog-description">
|
|
63
|
+
<DialogTitle id="alert-dialog-title">
|
|
64
|
+
{"Match to new column"}
|
|
65
|
+
</DialogTitle>
|
|
66
|
+
<DialogContent>
|
|
67
|
+
<DialogContentText id="alert-dialog-description">
|
|
68
|
+
inform the user about adding a new columna and what that means here...
|
|
69
|
+
</DialogContentText>
|
|
70
|
+
<Box sx={{paddingTop:2}}>
|
|
71
|
+
<TextField inputRef={newColumnNameRef} defaultValue={name} id="outlined-basic" label="Name" variant="outlined" fullWidth={true} />
|
|
72
|
+
</Box>
|
|
73
|
+
<Box sx={{paddingTop:2}}>
|
|
74
|
+
<TextField inputRef={newColumnDescriptionRef} id="outlined-basic" label="Description (optional)" variant="outlined" fullWidth={true} />
|
|
75
|
+
</Box>
|
|
76
|
+
<Box sx={{paddingTop:2}}>
|
|
77
|
+
<Box>
|
|
78
|
+
<Typography variant="body1" gutterBottom>
|
|
79
|
+
Select how this column will be formatted
|
|
80
|
+
</Typography>
|
|
81
|
+
</Box>
|
|
82
|
+
<Grid container spacing={2} sx={{paddingTop:2}}>
|
|
83
|
+
|
|
84
|
+
<AttributeTypeComponent id={0} icon={<TextFieldsRoundedIcon />} text={"text"} />
|
|
85
|
+
<AttributeTypeComponent id={1} icon={<LocalParkingRoundedIcon/>} text={"Paragraph"} />
|
|
86
|
+
<AttributeTypeComponent id={2} icon={<IntegrationInstructionsRoundedIcon/>} text={"HTML"} />
|
|
87
|
+
<AttributeTypeComponent id={3} icon={<Box>{123}</Box>} text={"Integer"} />
|
|
88
|
+
<AttributeTypeComponent id={4} icon={<Box>{10.23}</Box>} text={"Decimal"} />
|
|
89
|
+
<AttributeTypeComponent id={5} icon={<ListAltRoundedIcon/>} text={"Dropdown"} />
|
|
90
|
+
<AttributeTypeComponent id={6} icon={<CalendarMonthRoundedIcon/>} text={"Date"} />
|
|
91
|
+
<AttributeTypeComponent id={7} icon={<LinkRoundedIcon/>} text={"URL"} />
|
|
92
|
+
<AttributeTypeComponent id={8} icon={<CheckBoxRoundedIcon/>} text={"Boolean"} />
|
|
93
|
+
<AttributeTypeComponent id={9} icon={<InsertPhotoRoundedIcon/>} text={"Photo"} />
|
|
94
|
+
|
|
95
|
+
</Grid>
|
|
96
|
+
|
|
97
|
+
</Box>
|
|
98
|
+
|
|
99
|
+
</DialogContent>
|
|
100
|
+
<DialogActions>
|
|
101
|
+
<Button onClick={handleClose}>Cancel</Button>
|
|
102
|
+
<Button onClick={async () => {
|
|
103
|
+
|
|
104
|
+
let response = await apiService().post("/DocumentMapping/AddNewColumnAndMapping", {
|
|
105
|
+
companyId: companyId,
|
|
106
|
+
documentId: documentId,
|
|
107
|
+
documentMappingId: documentMappingId,
|
|
108
|
+
newColumn: newColumnNameRef.current.value,
|
|
109
|
+
description: newColumnDescriptionRef.current.value,
|
|
110
|
+
attributeFieldType: selectedAttributeId
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
if (response != null && response.status == 200)
|
|
114
|
+
{
|
|
115
|
+
handleClose();
|
|
116
|
+
onResponse();
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
}} autoFocus>
|
|
120
|
+
Create
|
|
121
|
+
</Button>
|
|
122
|
+
</DialogActions>
|
|
123
|
+
</Dialog>
|
|
124
|
+
|
|
125
|
+
{documentType != null && documentType == 1 &&
|
|
126
|
+
<Button startIcon={<AddRoundedIcon />} size="small" sx={{paddingLeft:3}} onClick={() => {
|
|
127
|
+
setCreateNewOpen(true);
|
|
128
|
+
}}>Create New Column</Button>
|
|
129
|
+
}
|
|
130
|
+
</Box>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {useSortable} from '@dnd-kit/sortable';
|
|
3
|
+
import {CSS} from '@dnd-kit/utilities';
|
|
4
|
+
import { ListItem, ListItemButton, ListItemIcon, ListItemText } from '@mui/material';
|
|
5
|
+
import MenuIcon from '@mui/icons-material/Menu';
|
|
6
|
+
|
|
7
|
+
export function SortableColumn(props) {
|
|
8
|
+
const {
|
|
9
|
+
attributes,
|
|
10
|
+
listeners,
|
|
11
|
+
setNodeRef,
|
|
12
|
+
transform,
|
|
13
|
+
transition,
|
|
14
|
+
} = useSortable({id: props.id});
|
|
15
|
+
|
|
16
|
+
const style = {
|
|
17
|
+
transform: CSS.Transform.toString(transform),
|
|
18
|
+
transition,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div ref={setNodeRef} style={style} {...attributes} {...listeners}>
|
|
23
|
+
<ListItem disablePadding>
|
|
24
|
+
<ListItemButton>
|
|
25
|
+
<ListItemIcon>
|
|
26
|
+
<MenuIcon />
|
|
27
|
+
</ListItemIcon>
|
|
28
|
+
<ListItemText primary={props.id} />
|
|
29
|
+
</ListItemButton>
|
|
30
|
+
</ListItem>
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import React, {useEffect, useState, useRef} from 'react';
|
|
2
|
+
// import { apiService, FileUploader} from 'authscape';
|
|
3
|
+
import Button from '@mui/material/Button';
|
|
4
|
+
import { Box } from '@mui/system';
|
|
5
|
+
import PublishRoundedIcon from '@mui/icons-material/PublishRounded';
|
|
6
|
+
import Menu from '@mui/material/Menu';
|
|
7
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
8
|
+
|
|
9
|
+
export function UploadMappedFile({loadedUser, url = null, companyId = null, locationId = null, userId = null}) {
|
|
10
|
+
|
|
11
|
+
const [documentComponentOptions, setDocumentComponentOptions] = useState(null);
|
|
12
|
+
|
|
13
|
+
const [selectedDocumentComponentId, setSelectedDocumentComponentId] = useState(null);
|
|
14
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
15
|
+
const open = Boolean(anchorEl);
|
|
16
|
+
const handleClose = () => {
|
|
17
|
+
setAnchorEl(null);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const fileUploaderRef = useRef(null);
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (selectedDocumentComponentId != null)
|
|
25
|
+
{
|
|
26
|
+
|
|
27
|
+
// trigger the file uploader, make sure param is filled in
|
|
28
|
+
fileUploaderRef.current.click();
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
}, [selectedDocumentComponentId])
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
|
|
35
|
+
if (loadedUser)
|
|
36
|
+
{
|
|
37
|
+
const fetchData = async () => {
|
|
38
|
+
|
|
39
|
+
let _params = {};
|
|
40
|
+
|
|
41
|
+
if (companyId != null)
|
|
42
|
+
{
|
|
43
|
+
_params.companyId = companyId;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (userId != null)
|
|
47
|
+
{
|
|
48
|
+
_params.userId = userId;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (locationId != null)
|
|
52
|
+
{
|
|
53
|
+
_params.locationId = locationId;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
let response = await apiService().post("/DocumentMapping/GetDocumentComponents", _params);
|
|
57
|
+
if (response != null && response.status == 200)
|
|
58
|
+
{
|
|
59
|
+
setDocumentComponentOptions(response.data.data);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
fetchData();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
}, [loadedUser])
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<Box>
|
|
69
|
+
|
|
70
|
+
<FileUploader refOveride={fileUploaderRef} params={{
|
|
71
|
+
|
|
72
|
+
documentComponentId: selectedDocumentComponentId,
|
|
73
|
+
companyId: companyId,
|
|
74
|
+
locationId: locationId,
|
|
75
|
+
userId: userId
|
|
76
|
+
|
|
77
|
+
}} url={url} multiple={false} variant='custom' onUploadCompleted={() => {
|
|
78
|
+
|
|
79
|
+
setSelectedDocumentComponentId(null); // we need an onUploadCancelled
|
|
80
|
+
|
|
81
|
+
}}>
|
|
82
|
+
|
|
83
|
+
</FileUploader>
|
|
84
|
+
|
|
85
|
+
<Button
|
|
86
|
+
id="demo-positioned-button"
|
|
87
|
+
aria-controls={open ? 'demo-positioned-menu' : undefined}
|
|
88
|
+
aria-haspopup="true"
|
|
89
|
+
aria-expanded={open ? 'true' : undefined}
|
|
90
|
+
startIcon={<PublishRoundedIcon />}
|
|
91
|
+
sx={{marginLeft:1}}
|
|
92
|
+
onClick={(event) => {
|
|
93
|
+
setAnchorEl(event.currentTarget);
|
|
94
|
+
}}>
|
|
95
|
+
Upload File(s)
|
|
96
|
+
</Button>
|
|
97
|
+
|
|
98
|
+
<Menu
|
|
99
|
+
id="basic-menu"
|
|
100
|
+
anchorEl={anchorEl}
|
|
101
|
+
open={open}
|
|
102
|
+
onClose={handleClose}
|
|
103
|
+
MenuListProps={{
|
|
104
|
+
'aria-labelledby': 'basic-button',
|
|
105
|
+
}}>
|
|
106
|
+
{documentComponentOptions != null && documentComponentOptions.map((documentComponent) => {
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<MenuItem onClick={() => {
|
|
110
|
+
|
|
111
|
+
// assigns the param document component id
|
|
112
|
+
setSelectedDocumentComponentId(documentComponent.id);
|
|
113
|
+
|
|
114
|
+
// close the menu
|
|
115
|
+
handleClose();
|
|
116
|
+
|
|
117
|
+
}}>{documentComponent.name + " (" + documentComponent.documentTypeName + ")"}</MenuItem>
|
|
118
|
+
)
|
|
119
|
+
})}
|
|
120
|
+
</Menu>
|
|
121
|
+
|
|
122
|
+
</Box>
|
|
123
|
+
)
|
|
124
|
+
}
|