Merge pull request #162 from SDSRV-IDP/feature/add_filter_review2
Feature/add filter review2
This commit is contained in:
commit
5fb227b2f2
@ -1,4 +1,4 @@
|
|||||||
import { AppstoreOutlined, BarChartOutlined, RotateRightOutlined, FileSearchOutlined } from '@ant-design/icons';
|
import { AppstoreOutlined, BarChartOutlined, RotateRightOutlined } from '@ant-design/icons';
|
||||||
import { t } from '@lingui/macro';
|
import { t } from '@lingui/macro';
|
||||||
import { Menu, MenuProps } from 'antd';
|
import { Menu, MenuProps } from 'antd';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
@ -4,7 +4,6 @@ export function GlobalSpin() {
|
|||||||
return (
|
return (
|
||||||
<Spin
|
<Spin
|
||||||
size='large'
|
size='large'
|
||||||
tip='Loading ...'
|
|
||||||
style={{
|
style={{
|
||||||
position: 'fixed',
|
position: 'fixed',
|
||||||
top: '50%',
|
top: '50%',
|
||||||
|
@ -105,7 +105,7 @@ export const fetchRequest = async (id: string) => {
|
|||||||
});
|
});
|
||||||
return await (
|
return await (
|
||||||
await response.json()
|
await response.json()
|
||||||
).subscription_requests[0];
|
).subscription_requests?.[0] || null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const addRecentRequest = (
|
export const addRecentRequest = (
|
||||||
|
@ -172,7 +172,7 @@ const ReviewPage = () => {
|
|||||||
|
|
||||||
const setAndLoadSelectedFile = async (requestData, index) => {
|
const setAndLoadSelectedFile = async (requestData, index) => {
|
||||||
setSelectedFileId(index);
|
setSelectedFileId(index);
|
||||||
if (!requestData['Files'][index]) {
|
if (!requestData?.['Files'][index]) {
|
||||||
setSelectedFileData('FAILED_TO_LOAD_FILE');
|
setSelectedFileData('FAILED_TO_LOAD_FILE');
|
||||||
setImageLoading(false);
|
setImageLoading(false);
|
||||||
return;
|
return;
|
||||||
@ -416,18 +416,18 @@ const ReviewPage = () => {
|
|||||||
style={
|
style={
|
||||||
fullscreen
|
fullscreen
|
||||||
? {
|
? {
|
||||||
position: 'fixed',
|
position: 'fixed',
|
||||||
top: 0,
|
top: 0,
|
||||||
left: 0,
|
left: 0,
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: '100%',
|
height: '100%',
|
||||||
backgroundColor: '#fff',
|
backgroundColor: '#fff',
|
||||||
zIndex: 1000,
|
zIndex: 1000,
|
||||||
}
|
}
|
||||||
: {
|
: {
|
||||||
height: '100%',
|
height: '100%',
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
@ -578,17 +578,17 @@ const ReviewPage = () => {
|
|||||||
overflow: 'auto',
|
overflow: 'auto',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Viewer
|
{selectedFileData && <Viewer
|
||||||
plugins={[defaultLayoutPluginInstance]}
|
plugins={[defaultLayoutPluginInstance]}
|
||||||
fileUrl={selectedFileData}
|
fileUrl={selectedFileData}
|
||||||
onDocumentLoad={() => setImageLoading(false)}
|
onDocumentLoad={() => setImageLoading(false)}
|
||||||
/>
|
/>}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
flexGrow: 1,
|
flexGrow: 1,
|
||||||
overflow: 'auto',
|
overflowY: 'auto',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
@ -756,11 +756,10 @@ const ReviewPage = () => {
|
|||||||
>
|
>
|
||||||
<Input
|
<Input
|
||||||
size='middle'
|
size='middle'
|
||||||
value={`Sub: ${filterSubsidiaries}, Date:${
|
value={`Sub: ${filterSubsidiaries}, Date:${filterDateRange[0]
|
||||||
filterDateRange[0]
|
? filterDateRange[0] + ' to ' + filterDateRange[1]
|
||||||
? filterDateRange[0] + ' to ' + filterDateRange[1]
|
: 'All'
|
||||||
: 'All'
|
}, Reviewed: ${filterReviewState}, Tests: ${filterIncludeTests}`}
|
||||||
}, Reviewed: ${filterReviewState}, Tests: ${filterIncludeTests}`}
|
|
||||||
readOnly
|
readOnly
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
@ -781,12 +780,12 @@ const ReviewPage = () => {
|
|||||||
let shouldRevised = false;
|
let shouldRevised = false;
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
selectedFileDataSource[data]?.[FEEDBACK_ACCURACY].length > 0
|
selectedFileDataSource[data]?.[FEEDBACK_ACCURACY]?.length > 0
|
||||||
) {
|
) {
|
||||||
shouldRevised =
|
shouldRevised =
|
||||||
selectedFileDataSource[data][FEEDBACK_ACCURACY][0] < 1;
|
selectedFileDataSource[data][FEEDBACK_ACCURACY][0] < 1;
|
||||||
}
|
}
|
||||||
} catch (error) {}
|
} catch (error) { }
|
||||||
return (
|
return (
|
||||||
<div style={{ margin: '0 0 8px' }} className='file-input-group' key={data}>
|
<div style={{ margin: '0 0 8px' }} className='file-input-group' key={data}>
|
||||||
<div
|
<div
|
||||||
@ -875,7 +874,7 @@ const ReviewPage = () => {
|
|||||||
options={SOLUTION_BAD_QUALITY}
|
options={SOLUTION_BAD_QUALITY}
|
||||||
onChange={setSolution}
|
onChange={setSolution}
|
||||||
value={solution}
|
value={solution}
|
||||||
// defaultValue={solution}
|
// defaultValue={solution}
|
||||||
/>
|
/>
|
||||||
{solution === 'other' && (
|
{solution === 'other' && (
|
||||||
<Input
|
<Input
|
||||||
@ -1103,7 +1102,7 @@ const ReviewPage = () => {
|
|||||||
name='reviewed_result'
|
name='reviewed_result'
|
||||||
label={t`Review inculdes`}
|
label={t`Review inculdes`}
|
||||||
>
|
>
|
||||||
<Input
|
<Input
|
||||||
defaultValue={filterReviewedResult}
|
defaultValue={filterReviewedResult}
|
||||||
onChange={(e) => setFilterReviewedResult(e.target.value)}
|
onChange={(e) => setFilterReviewedResult(e.target.value)}
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user