hide AUTHORIZED_USE and NOT_OWNER_FILE button while match in work
This commit is contained in:
@@ -18,6 +18,8 @@ import { createPortal } from 'react-dom';
|
|||||||
import { IconContentCopy, IconFollowToLink, IconFullScreen } from '@/app/ui/icons/icons';
|
import { IconContentCopy, IconFollowToLink, IconFullScreen } from '@/app/ui/icons/icons';
|
||||||
import { useViewport } from '@/app/hooks/useViewport';
|
import { useViewport } from '@/app/hooks/useViewport';
|
||||||
|
|
||||||
|
const IN_WORK_STATUS = ['COMPLAINT_AND_LEGAL_IN_WORK', 'LEGAL_IN_WORK', 'COMPLAINT_IN_WORK'];
|
||||||
|
|
||||||
export default function FilePageViolationInfo(
|
export default function FilePageViolationInfo(
|
||||||
{
|
{
|
||||||
selectedViolation,
|
selectedViolation,
|
||||||
@@ -67,7 +69,6 @@ export default function FilePageViolationInfo(
|
|||||||
queryClient.invalidateQueries({ queryKey: ['violationData'] });
|
queryClient.invalidateQueries({ queryKey: ['violationData'] });
|
||||||
queryClient.invalidateQueries({ queryKey: ['lastCases'] });
|
queryClient.invalidateQueries({ queryKey: ['lastCases'] });
|
||||||
queryClient.invalidateQueries({ queryKey: ['lastComplaints'] });
|
queryClient.invalidateQueries({ queryKey: ['lastComplaints'] });
|
||||||
|
|
||||||
|
|
||||||
if (status === 'NOT_OWNER_FILE') {
|
if (status === 'NOT_OWNER_FILE') {
|
||||||
console.log('NOT_OWNER_FILE');
|
console.log('NOT_OWNER_FILE');
|
||||||
@@ -333,28 +334,33 @@ export default function FilePageViolationInfo(
|
|||||||
<div
|
<div
|
||||||
className="violation-info-action"
|
className="violation-info-action"
|
||||||
>
|
>
|
||||||
<button
|
{!IN_WORK_STATUS.includes(selectedViolation.status) && (
|
||||||
className="btn-s btn-no-my-file"
|
<button
|
||||||
onClick={() => {
|
className="btn-s btn-no-my-file"
|
||||||
if (selectedViolation?.id) {
|
onClick={() => {
|
||||||
updateStatusHandler(selectedViolation.id, 'NOT_OWNER_FILE');
|
if (selectedViolation?.id) {
|
||||||
}
|
updateStatusHandler(selectedViolation.id, 'NOT_OWNER_FILE');
|
||||||
}}
|
}
|
||||||
disabled={isUpdating}
|
}}
|
||||||
>
|
disabled={isUpdating}
|
||||||
{tStatus('NOT_OWNER_FILE')}
|
>
|
||||||
</button>
|
{tStatus('NOT_OWNER_FILE')}
|
||||||
<button
|
</button>
|
||||||
className="btn-s btn-resolve"
|
)}
|
||||||
onClick={() => {
|
|
||||||
if (selectedViolation?.id) {
|
{!IN_WORK_STATUS.includes(selectedViolation.status) && (
|
||||||
updateStatusHandler(selectedViolation.id, 'AUTHORIZED_USE');
|
<button
|
||||||
}
|
className="btn-s btn-resolve"
|
||||||
}}
|
onClick={() => {
|
||||||
disabled={isUpdating}
|
if (selectedViolation?.id) {
|
||||||
>
|
updateStatusHandler(selectedViolation.id, 'AUTHORIZED_USE');
|
||||||
{t('allow-use')}
|
}
|
||||||
</button>
|
}}
|
||||||
|
disabled={isUpdating}
|
||||||
|
>
|
||||||
|
{t('allow-use')}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -585,7 +585,7 @@
|
|||||||
"VERIFIED": "Верифицирован",
|
"VERIFIED": "Верифицирован",
|
||||||
"VERIFICATION_FAILED": "Верификация не удалась",
|
"VERIFICATION_FAILED": "Верификация не удалась",
|
||||||
"unknow": "Неизвестно",
|
"unknow": "Неизвестно",
|
||||||
"user-verification": "Верификация юзера",
|
"user-verification": "Верификация пользователя",
|
||||||
"Status": "Статус"
|
"Status": "Статус"
|
||||||
},
|
},
|
||||||
"Countryes": {
|
"Countryes": {
|
||||||
|
|||||||
Reference in New Issue
Block a user