diff --git a/src/app/actions/violationActions.ts b/src/app/actions/violationActions.ts index e75952b..b95e12e 100644 --- a/src/app/actions/violationActions.ts +++ b/src/app/actions/violationActions.ts @@ -404,7 +404,7 @@ export async function fetchComplainInfo(id: number) { } } -export type MatchStatus = 'NEW' | 'SHOWED' | 'LEGAL_IN_WORK' | 'COMPLAINT_IN_WORK' | 'COMPLAINT_AND_LEGAL_IN_WORK' | 'AUTHORIZED_USE'; +export type MatchStatus = 'NEW' | 'SHOWED' | 'LEGAL_IN_WORK' | 'COMPLAINT_IN_WORK' | 'COMPLAINT_AND_LEGAL_IN_WORK' | 'AUTHORIZED_USE' | 'NOT_OWNER_FILE'; export async function updateMatchStatus(id: number, status: MatchStatus) { const token = await getSessionData('token'); diff --git a/src/app/styles/violation-details.scss b/src/app/styles/violation-details.scss index cfaf70a..bf943e0 100644 --- a/src/app/styles/violation-details.scss +++ b/src/app/styles/violation-details.scss @@ -575,6 +575,8 @@ &-action { margin-top: auto; + display: flex; + gap: 10px } &-actions { diff --git a/src/app/ui/file-page/violation-table/file-page-violation-info.tsx b/src/app/ui/file-page/violation-table/file-page-violation-info.tsx index 8bff9ca..f57d67e 100644 --- a/src/app/ui/file-page/violation-table/file-page-violation-info.tsx +++ b/src/app/ui/file-page/violation-table/file-page-violation-info.tsx @@ -18,7 +18,18 @@ import { createPortal } from 'react-dom'; import { IconContentCopy, IconFollowToLink, IconFullScreen } from '@/app/ui/icons/icons'; import { useViewport } from '@/app/hooks/useViewport'; -export default function FilePageViolationInfo({ selectedViolation, caseType }: { selectedViolation: ViolationFileDetail | null, caseType?: 'claim' | 'complaint' }) { +export default function FilePageViolationInfo( + { + selectedViolation, + caseType, + callBackSelectedViolation + }: + { + selectedViolation: ViolationFileDetail | null, + caseType?: 'claim' | 'complaint', + callBackSelectedViolation: React.Dispatch>, + } +) { const t = useTranslations('Global'); const tStatus = useTranslations('Match-status'); const queryClient = useQueryClient(); @@ -53,6 +64,13 @@ export default function FilePageViolationInfo({ selectedViolation, caseType }: { } queryClient.invalidateQueries({ queryKey: ['fileViolations'] }); queryClient.invalidateQueries({ queryKey: ['complainInfo', id] }); + + if (status === 'NOT_OWNER_FILE') { + console.log('NOT_OWNER_FILE'); + setLocalViolation(null); + callBackSelectedViolation(null); + } + return true; } else { setLocalViolation(selectedViolation); @@ -311,6 +329,17 @@ export default function FilePageViolationInfo({ selectedViolation, caseType }: {
+
{/* general info for match */} - + {/* pagination */} diff --git a/src/i18n/messages/en.json b/src/i18n/messages/en.json index 0059d77..a337878 100644 --- a/src/i18n/messages/en.json +++ b/src/i18n/messages/en.json @@ -556,7 +556,8 @@ "COMPLAINT_IN_WORK": "Complaint in work", "COMPLAINT_AND_LEGAL_IN_WORK": "Complaint and legal in work", "AUTHORIZED_USE": "Authorized use", - "CREATED": "New" + "CREATED": "New", + "NOT_OWNER_FILE": "Not my file" }, "Notifications": { "notification-search-result": "Search result", diff --git a/src/i18n/messages/ru.json b/src/i18n/messages/ru.json index e7b9051..a45768a 100644 --- a/src/i18n/messages/ru.json +++ b/src/i18n/messages/ru.json @@ -556,7 +556,8 @@ "COMPLAINT_IN_WORK": "Жалоба в работе", "COMPLAINT_AND_LEGAL_IN_WORK": "Дело и претензия в работе", "AUTHORIZED_USE": "Разрешенное использование", - "CREATED": "Новый" + "CREATED": "Новый", + "NOT_OWNER_FILE": "Не мой файл" }, "Notifications": { "notification-search-result": "Результат поиска",