authscape 1.0.622 → 1.0.626
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 +181 -2348
- package/package.json +1 -10
- package/src/components/AuthScapeApp.js +1 -1
- package/src/components/EditableDatagrid.js +1 -1
- package/src/components/FileUploader.js +2 -2
- package/src/components/GoogleMapsAutoComplete.js +3 -5
- package/src/components/PlansAndPricing.js +4 -2
- package/src/components/RichTextEditor.js +2 -1
- package/src/components/dropzone.js +1 -1
- package/src/components/spreadsheet/spreadsheetViewer.js +11 -6
- package/src/components/stripe/StripePayment.js +8 -1
- package/src/components/mapping/assignMapping.js +0 -237
- package/src/components/mapping/conditionBasedTool.js +0 -99
- package/src/components/mapping/datasources.js +0 -259
- package/src/components/mapping/fileMapping.js +0 -72
- package/src/components/mapping/manageMappingDocuments.js +0 -525
- package/src/components/mapping/mappedColumn.js +0 -70
- package/src/components/mapping/matchExisting.js +0 -135
- package/src/components/mapping/newMappingColumn.js +0 -132
- package/src/components/mapping/sortableColumn.js +0 -33
- package/src/components/mapping/uploadMappedFile.js +0 -124
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "authscape",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.626",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -10,8 +10,6 @@
|
|
|
10
10
|
"author": "zuechb",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"@stripe/react-stripe-js": "^1.9.0",
|
|
14
|
-
"@stripe/stripe-js": "^1.32.0",
|
|
15
13
|
"js-file-download": "^0.4.12",
|
|
16
14
|
"nookies": "^2.5.2",
|
|
17
15
|
"react-data-table-component": "^7.5.2",
|
|
@@ -28,14 +26,7 @@
|
|
|
28
26
|
"@emotion/react": "^11.11.3",
|
|
29
27
|
"@emotion/styled": "^11.11.0",
|
|
30
28
|
"@microsoft/signalr": "^8.0.0",
|
|
31
|
-
"@monaco-editor/react": "^4.5.1",
|
|
32
|
-
"@mui/x-data-grid": "^7.3.2",
|
|
33
|
-
"@mui/x-date-pickers": "^6.18.3",
|
|
34
|
-
"@stripe/react-stripe-js": "^1.9.0",
|
|
35
|
-
"@stripe/stripe-js": "^1.32.0",
|
|
36
29
|
"axios": "^1.6.1",
|
|
37
|
-
"draft-js": "^0.11.7",
|
|
38
|
-
"draftjs-to-html": "^0.9.1",
|
|
39
30
|
"eslint-config-next": "^14.1.0",
|
|
40
31
|
"ga-4-react": "^0.1.281",
|
|
41
32
|
"html2canvas": "^1.4.1",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, {useState, useRef, useEffect} from 'react';
|
|
2
2
|
import { ToastContainer, toast } from 'react-toastify';
|
|
3
|
-
import
|
|
3
|
+
import ThemeProvider from '@mui/material/styles/ThemeProvider';
|
|
4
4
|
import Head from "next/head";
|
|
5
5
|
import { useSearchParams, usePathname } from 'next/navigation';
|
|
6
6
|
import axios from 'axios';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, {useEffect, useState} from 'react';
|
|
2
2
|
import { DataGrid, GridActionsCellItem } from "@mui/x-data-grid";
|
|
3
|
-
import
|
|
3
|
+
import Box from '@mui/material/Box';
|
|
4
4
|
|
|
5
5
|
export const EditableDatagrid = ({url = null, eRows = null, columns, isCellEditable = null, onCellClick = null, onCellEdited = null, params = null, sx = {}, height="50vh", pageSize = 50, rowsPerPage = [25, 50, 100], rowHeight = 70, key = null, onRowClick = null}) => {
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useRef, useEffect } from "react";
|
|
2
2
|
import LinearProgress from "@mui/material/LinearProgress";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import Box from "@mui/system/Box";
|
|
4
|
+
import Grid from "@mui/material/Grid";
|
|
5
5
|
import FileCopyRoundedIcon from "@mui/icons-material/FileCopyRounded";
|
|
6
6
|
import UploadRoundedIcon from "@mui/icons-material/UploadRounded";
|
|
7
7
|
import Typography from "@mui/material/Typography";
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import React, { useState, useRef, useEffect } from "react";
|
|
2
|
-
import
|
|
3
|
-
import { Box } from "@mui/system";
|
|
2
|
+
import Box from "@mui/system/Box";
|
|
4
3
|
import TextField from "@mui/material/TextField";
|
|
5
4
|
import Grid from "@mui/material/Grid";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
5
|
+
import MenuList from "@mui/material/MenuList";
|
|
6
|
+
import MenuItem from "@mui/material/MenuItem";
|
|
8
7
|
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
9
8
|
import LocationOnRoundedIcon from '@mui/icons-material/LocationOnRounded';
|
|
10
9
|
import ListItemText from '@mui/material/ListItemText';
|
|
11
10
|
import useOnclickOutside from "react-cool-onclickoutside";
|
|
12
|
-
import { useForm, Controller, useFieldArray } from "react-hook-form";
|
|
13
11
|
import Stack from "@mui/material/Stack";
|
|
14
12
|
|
|
15
13
|
import usePlacesAutocomplete, {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { Box } from '@mui/system';
|
|
3
|
-
import
|
|
3
|
+
import Grid from '@mui/material/Grid';
|
|
4
|
+
import Button from '@mui/material/Button';
|
|
5
|
+
import Typography from '@mui/material/Typography';
|
|
4
6
|
import ChevronRightRoundedIcon from '@mui/icons-material/ChevronRightRounded';
|
|
5
7
|
import InputLabel from '@mui/material/InputLabel';
|
|
6
8
|
import MenuItem from '@mui/material/MenuItem';
|
|
@@ -2,7 +2,8 @@ import React, { useState, useEffect } from "react";
|
|
|
2
2
|
import { convertToRaw, EditorState, ContentState, convertFromHTML } from "draft-js";
|
|
3
3
|
import draftToHtml from "draftjs-to-html";
|
|
4
4
|
import dynamic from 'next/dynamic';
|
|
5
|
-
import
|
|
5
|
+
import Box from "@mui/material/Box";
|
|
6
|
+
import Button from "@mui/material/Button";
|
|
6
7
|
|
|
7
8
|
const Editor = dynamic(
|
|
8
9
|
() => import('react-draft-wysiwyg').then(mod => mod.Editor),
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
import { Box, Button, List, ListItem, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow } from '@mui/material';
|
|
2
1
|
import React, { useEffect, useState, useRef, useImperativeHandle, forwardRef } from 'react';
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
|
|
3
|
+
import Box from '@mui/material/Box';
|
|
4
|
+
import Button from '@mui/material/Button';
|
|
5
|
+
import List from '@mui/material/List';
|
|
6
|
+
import Table from '@mui/material/Table';
|
|
7
|
+
import TableBody from '@mui/material/TableBody';
|
|
8
|
+
import TableCell from '@mui/material/TableCell';
|
|
9
|
+
import TableContainer from '@mui/material/TableContainer';
|
|
10
|
+
import TableHead from '@mui/material/TableHead';
|
|
11
|
+
import TableRow from '@mui/material/TableRow';
|
|
12
|
+
import { ReactGrid } from "@silevis/reactgrid";
|
|
5
13
|
import {isMacOs} from 'react-device-detect';
|
|
6
14
|
import * as signalR from '@microsoft/signalr';
|
|
7
15
|
import Avatar from '@mui/material/Avatar';
|
|
8
16
|
import Stack from '@mui/material/Stack';
|
|
9
17
|
import Tooltip from '@mui/material/Tooltip';
|
|
10
|
-
|
|
11
18
|
import AppBar from '@mui/material/AppBar';
|
|
12
19
|
import Toolbar from '@mui/material/Toolbar';
|
|
13
20
|
import VisibilityOffRoundedIcon from '@mui/icons-material/VisibilityOffRounded';
|
|
@@ -16,14 +23,12 @@ import SwapVertRoundedIcon from '@mui/icons-material/SwapVertRounded';
|
|
|
16
23
|
import LineWeightRoundedIcon from '@mui/icons-material/LineWeightRounded';
|
|
17
24
|
import PivotTableChartRoundedIcon from '@mui/icons-material/PivotTableChartRounded';
|
|
18
25
|
import ViewWeekRoundedIcon from '@mui/icons-material/ViewWeekRounded';
|
|
19
|
-
|
|
20
26
|
import Dialog from '@mui/material/Dialog';
|
|
21
27
|
import DialogActions from '@mui/material/DialogActions';
|
|
22
28
|
import DialogContent from '@mui/material/DialogContent';
|
|
23
29
|
import DialogContentText from '@mui/material/DialogContentText';
|
|
24
30
|
import DialogTitle from '@mui/material/DialogTitle';
|
|
25
31
|
import TextField from '@mui/material/TextField';
|
|
26
|
-
|
|
27
32
|
import {DndContext} from '@dnd-kit/core';
|
|
28
33
|
import {SortableContext} from '@dnd-kit/sortable';
|
|
29
34
|
// import { SortableColumn } from './Mapping/sortableColumn';
|
|
@@ -3,7 +3,14 @@ import {Elements, useStripe, useElements, PaymentElement} from '@stripe/react-st
|
|
|
3
3
|
import {loadStripe} from '@stripe/stripe-js';
|
|
4
4
|
import PaymentRoundedIcon from '@mui/icons-material/PaymentRounded';
|
|
5
5
|
import Typography from '@mui/material/Typography';
|
|
6
|
-
import
|
|
6
|
+
import Select from '@mui/material/Select';
|
|
7
|
+
import Grid from '@mui/material/Grid';
|
|
8
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
9
|
+
import Box from '@mui/material/Box';
|
|
10
|
+
import Button from '@mui/material/Button';
|
|
11
|
+
import Tab from '@mui/material/Tab';
|
|
12
|
+
import Tabs from '@mui/material/Tabs';
|
|
13
|
+
import TextField from '@mui/material/TextField';
|
|
7
14
|
|
|
8
15
|
const CheckoutForm = ({payButtonText, invoiceId, clientSecret, currentUser, paymentMethodType, walletId, onResponse, amount}) => {
|
|
9
16
|
|
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
import React, {useEffect, useState, useRef} from 'react';
|
|
2
|
-
import { Box } from '@mui/system';
|
|
3
|
-
// import { apiService } from 'authscape';
|
|
4
|
-
// import MappedColumn from './MappedColumn';
|
|
5
|
-
import Container from '@mui/material/Container';
|
|
6
|
-
import Typography from '@mui/material/Typography';
|
|
7
|
-
import { Button, Grid } from '@mui/material';
|
|
8
|
-
// import ConditionBasedTool from './conditionBasedTool';
|
|
9
|
-
import Dialog from '@mui/material/Dialog';
|
|
10
|
-
import DialogActions from '@mui/material/DialogActions';
|
|
11
|
-
import DialogContent from '@mui/material/DialogContent';
|
|
12
|
-
import DialogTitle from '@mui/material/DialogTitle';
|
|
13
|
-
// import SpreadsheetViewer from '../spreadsheetViewer';
|
|
14
|
-
import CloseIcon from '@mui/icons-material/Close';
|
|
15
|
-
import IconButton from '@mui/material/IconButton';
|
|
16
|
-
import ArrowRightAltRoundedIcon from '@mui/icons-material/ArrowRightAltRounded';
|
|
17
|
-
|
|
18
|
-
export function AssignMapping({currentUser, documentComponentId, setIsLoading = null, onCancel = null, onPublished = null}) {
|
|
19
|
-
|
|
20
|
-
const [documentId, setDocumentId] = useState(documentComponentId);
|
|
21
|
-
|
|
22
|
-
const [fromColumnOptions, setFromColumnOptions] = useState(null);
|
|
23
|
-
const [toColumnOptions, setToColumnOptions] = useState(null);
|
|
24
|
-
const [documentType, setDocumentType] = useState(null);
|
|
25
|
-
const [documentName, setDocumentName] = useState(null);
|
|
26
|
-
const [urlTick, setURLTick] = useState(1);
|
|
27
|
-
const [spreadSheetAddress, setSpreadSheetAddress] = useState(null);
|
|
28
|
-
const [showPreviewDialog, setShowPreviewDialog] = useState(false);
|
|
29
|
-
|
|
30
|
-
const [advanceQuery, setAdvanceQuery] = useState(null);
|
|
31
|
-
|
|
32
|
-
const spreadSheetRef = useRef(null);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const fetchMappingTo = async () => {
|
|
36
|
-
|
|
37
|
-
let response = await apiService().get("/DocumentMapping/GetMappedDynamicFieldsForCompany?companyId=" + currentUser.companyId + "&documentId=" + documentComponentId);
|
|
38
|
-
if (response != null)
|
|
39
|
-
{
|
|
40
|
-
setToColumnOptions(response.data);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const fetchMappingFrom = async () => {
|
|
45
|
-
let response = await apiService().post("/DocumentMapping/GetMapping", {
|
|
46
|
-
documentComponentId: documentComponentId,
|
|
47
|
-
companyId: currentUser.companyId
|
|
48
|
-
});
|
|
49
|
-
if (response != null)
|
|
50
|
-
{
|
|
51
|
-
setFromColumnOptions(response.data.documentMappings);
|
|
52
|
-
setDocumentName(response.data.name);
|
|
53
|
-
setDocumentType(response.data.documentType);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
useEffect(() => {
|
|
58
|
-
|
|
59
|
-
if (documentComponentId != null)
|
|
60
|
-
{
|
|
61
|
-
if (setIsLoading != null)
|
|
62
|
-
{
|
|
63
|
-
setIsLoading(true);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
setSpreadSheetAddress("/DocumentMappingPreview/PreviewMappedData?companyId=" + currentUser.companyId + "&documentComponentId=" + documentComponentId);
|
|
67
|
-
|
|
68
|
-
const fetchData = async () => {
|
|
69
|
-
await fetchMappingFrom();
|
|
70
|
-
await fetchMappingTo();
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if (setIsLoading != null)
|
|
74
|
-
{
|
|
75
|
-
setIsLoading(false);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
fetchData();
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
}, [documentComponentId])
|
|
84
|
-
|
|
85
|
-
return (
|
|
86
|
-
<Box>
|
|
87
|
-
<Container maxWidth="xl" sx={{marginTop:2}}>
|
|
88
|
-
<Grid container spacing={2}>
|
|
89
|
-
<Grid item xs={6}>
|
|
90
|
-
<Box sx={{position:"sticky", top:20}}>
|
|
91
|
-
<Typography variant="h4" gutterBottom sx={{paddingBottom:2}}>
|
|
92
|
-
File Uploaded: <br/> {documentName}
|
|
93
|
-
</Typography>
|
|
94
|
-
|
|
95
|
-
<Typography variant="subtitle1" gutterBottom sx={{paddingBottom:2}}>
|
|
96
|
-
You have {fromColumnOptions != null && fromColumnOptions.length} columns that can be created or mapped
|
|
97
|
-
</Typography>
|
|
98
|
-
|
|
99
|
-
<Button variant="outlined" sx={{marginRight:2}} onClick={async () => {
|
|
100
|
-
|
|
101
|
-
if (onCancel != null)
|
|
102
|
-
{
|
|
103
|
-
onCancel();
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
}}>Cancel</Button>
|
|
107
|
-
|
|
108
|
-
<Button variant="contained" endIcon={<ArrowRightAltRoundedIcon/>} sx={{marginRight:2}} onClick={() => {
|
|
109
|
-
|
|
110
|
-
setShowPreviewDialog(true);
|
|
111
|
-
|
|
112
|
-
}}>Next, Preview your mapping</Button>
|
|
113
|
-
|
|
114
|
-
</Box>
|
|
115
|
-
</Grid>
|
|
116
|
-
|
|
117
|
-
<Grid item xs={5}>
|
|
118
|
-
{fromColumnOptions != null && fromColumnOptions.map((column) => {
|
|
119
|
-
return (
|
|
120
|
-
<Box>
|
|
121
|
-
|
|
122
|
-
<MappedColumn companyId={currentUser.companyId} documentId={documentId} documentType={documentType} documentMappingId={column.id} name={column.name} toName={column.toName} isMapped={(column.toName == null || column.toName == "") ? true : false} toOptions={toColumnOptions} onResponse={() => {
|
|
123
|
-
|
|
124
|
-
fetchMappingFrom();
|
|
125
|
-
fetchMappingTo();
|
|
126
|
-
|
|
127
|
-
}} />
|
|
128
|
-
|
|
129
|
-
</Box>
|
|
130
|
-
)
|
|
131
|
-
})}
|
|
132
|
-
</Grid>
|
|
133
|
-
</Grid>
|
|
134
|
-
</Container>
|
|
135
|
-
|
|
136
|
-
<Dialog
|
|
137
|
-
open={showPreviewDialog}
|
|
138
|
-
onClose={() => {
|
|
139
|
-
setShowPreviewDialog(false);
|
|
140
|
-
}}
|
|
141
|
-
fullWidth={true}
|
|
142
|
-
maxWidth={"xl"}
|
|
143
|
-
aria-labelledby="alert-dialog-title"
|
|
144
|
-
aria-describedby="alert-dialog-description">
|
|
145
|
-
<DialogTitle id="alert-dialog-title" sx={{fontSize:"25px", paddingTop:4}}>
|
|
146
|
-
{"Preview your mapping"}
|
|
147
|
-
</DialogTitle>
|
|
148
|
-
|
|
149
|
-
<Box sx={{paddingLeft:3}}>
|
|
150
|
-
Ensure that the data uploaded is accurately mapped and all (Required) fields are completed.
|
|
151
|
-
</Box>
|
|
152
|
-
|
|
153
|
-
<IconButton
|
|
154
|
-
aria-label="close"
|
|
155
|
-
onClick={() => {
|
|
156
|
-
setShowPreviewDialog(false);
|
|
157
|
-
}}
|
|
158
|
-
sx={{
|
|
159
|
-
position: 'absolute',
|
|
160
|
-
right: 8,
|
|
161
|
-
top: 8,
|
|
162
|
-
color: (theme) => theme.palette.grey[500],
|
|
163
|
-
}}
|
|
164
|
-
>
|
|
165
|
-
<CloseIcon />
|
|
166
|
-
</IconButton>
|
|
167
|
-
|
|
168
|
-
<DialogContent>
|
|
169
|
-
|
|
170
|
-
<Box sx={{paddingBottom:1}}>
|
|
171
|
-
<ConditionBasedTool toColumnOptions={toColumnOptions} documentId={documentId} onConditionApplied={(currentQuery) => {
|
|
172
|
-
|
|
173
|
-
let incrementNum = urlTick + 1;
|
|
174
|
-
setURLTick(incrementNum);
|
|
175
|
-
|
|
176
|
-
setAdvanceQuery(currentQuery);
|
|
177
|
-
|
|
178
|
-
// setSpreadSheetAddress("/DocumentMappingPreview/PreviewMappedData?companyId=" + currentUser.companyId + "&documentComponentId=" + documentComponentId + "&tick=" + incrementNum);
|
|
179
|
-
|
|
180
|
-
}} />
|
|
181
|
-
</Box>
|
|
182
|
-
|
|
183
|
-
{spreadSheetAddress != null &&
|
|
184
|
-
<SpreadsheetViewer ref={spreadSheetRef} url={spreadSheetAddress} advanceQuery={advanceQuery} currentUser={currentUser} hideToolbar={true} loadedUser={true} />
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
</DialogContent>
|
|
188
|
-
<DialogActions>
|
|
189
|
-
<Button onClick={() => {
|
|
190
|
-
|
|
191
|
-
setShowPreviewDialog(false);
|
|
192
|
-
|
|
193
|
-
}}>Cancel</Button>
|
|
194
|
-
<Button variant="contained" onClick={async () => {
|
|
195
|
-
|
|
196
|
-
if (setIsLoading != null)
|
|
197
|
-
{
|
|
198
|
-
setIsLoading(true);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
let publishedRows = spreadSheetRef.current.getRows();
|
|
202
|
-
|
|
203
|
-
let response = await apiService().post("/DocumentMapping/Publish", {
|
|
204
|
-
companyId: currentUser.companyId,
|
|
205
|
-
documentId: documentId,
|
|
206
|
-
publishedRows: publishedRows
|
|
207
|
-
});
|
|
208
|
-
|
|
209
|
-
if (response != null && response.status == 200)
|
|
210
|
-
{
|
|
211
|
-
setShowPreviewDialog(false);
|
|
212
|
-
|
|
213
|
-
if (onPublished != null)
|
|
214
|
-
{
|
|
215
|
-
onPublished();
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
else
|
|
219
|
-
{
|
|
220
|
-
alert(JSON.stringify(response.data));
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
if (setIsLoading != null)
|
|
224
|
-
{
|
|
225
|
-
setIsLoading(false);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
}}>
|
|
229
|
-
Publish
|
|
230
|
-
</Button>
|
|
231
|
-
</DialogActions>
|
|
232
|
-
</Dialog>
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
</Box>
|
|
236
|
-
)
|
|
237
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import React, {useEffect, useState, useRef} from 'react';
|
|
3
|
-
// import { apiService, FileUploader} from 'authscape';
|
|
4
|
-
import Button from '@mui/material/Button';
|
|
5
|
-
import { Box } from '@mui/system';
|
|
6
|
-
import Accordion from '@mui/material/Accordion';
|
|
7
|
-
import AccordionSummary from '@mui/material/AccordionSummary';
|
|
8
|
-
import AccordionDetails from '@mui/material/AccordionDetails';
|
|
9
|
-
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
10
|
-
import { QueryBuilder } from 'react-querybuilder';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export function ConditionBasedTool({toColumnOptions, documentId, onConditionApplied}) {
|
|
14
|
-
|
|
15
|
-
const [currentQuery, setCurrentQuery] = useState(null);
|
|
16
|
-
|
|
17
|
-
// const fields = [
|
|
18
|
-
// { name: 'firstName', label: 'First Name' },
|
|
19
|
-
// { name: 'lastName', label: 'Last Name' }
|
|
20
|
-
// ];
|
|
21
|
-
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
|
|
24
|
-
if (documentId != null)
|
|
25
|
-
{
|
|
26
|
-
const fetchData = async () => {
|
|
27
|
-
let response = await apiService().get("/DocumentMapping/GetRules?documentComponentId=" + documentId);
|
|
28
|
-
if (response != null && response.status == 200)
|
|
29
|
-
{
|
|
30
|
-
if (response.data != null && response.data != "")
|
|
31
|
-
{
|
|
32
|
-
setCurrentQuery(response.data);
|
|
33
|
-
}
|
|
34
|
-
else
|
|
35
|
-
{
|
|
36
|
-
setCurrentQuery(null);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
fetchData();
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}, [documentId]);
|
|
45
|
-
|
|
46
|
-
const getFields = () => {
|
|
47
|
-
|
|
48
|
-
let fields = [];
|
|
49
|
-
|
|
50
|
-
for (let index = 0; index < toColumnOptions.length; index++) {
|
|
51
|
-
const toColumn = toColumnOptions[index];
|
|
52
|
-
|
|
53
|
-
if (toColumn.isMapped) // only show filters that are mapped
|
|
54
|
-
{
|
|
55
|
-
fields.push({ name: toColumn.name, label: toColumn.visibleName });
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return fields;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const customOperators = [
|
|
63
|
-
{ name: 'contains', label: 'Contains' },
|
|
64
|
-
{ name: 'notContains', label: 'Does not contain' },
|
|
65
|
-
];
|
|
66
|
-
|
|
67
|
-
return (
|
|
68
|
-
<>
|
|
69
|
-
<Box>
|
|
70
|
-
<Accordion>
|
|
71
|
-
<AccordionSummary
|
|
72
|
-
expandIcon={<ExpandMoreIcon />}
|
|
73
|
-
aria-controls="panel1-content"
|
|
74
|
-
id="panel1-header">
|
|
75
|
-
Advance filtering
|
|
76
|
-
</AccordionSummary>
|
|
77
|
-
<AccordionDetails>
|
|
78
|
-
<QueryBuilder fields={getFields()} operators={customOperators} query={currentQuery} onQueryChange={setCurrentQuery} />
|
|
79
|
-
|
|
80
|
-
<Button variant="contained" sx={{marginTop:1}} onClick={async () => {
|
|
81
|
-
|
|
82
|
-
let response = await apiService().put("/DocumentMapping/ApplyFilterForViewer", {
|
|
83
|
-
documentComponentId: documentId,
|
|
84
|
-
rules: JSON.stringify(currentQuery)
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
if (response != null && response.status == 200)
|
|
88
|
-
{
|
|
89
|
-
onConditionApplied(currentQuery);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
}}>Apply Filter</Button>
|
|
93
|
-
</AccordionDetails>
|
|
94
|
-
</Accordion>
|
|
95
|
-
|
|
96
|
-
</Box>
|
|
97
|
-
</>
|
|
98
|
-
)
|
|
99
|
-
}
|