add not my file button
This commit is contained in:
@@ -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) {
|
export async function updateMatchStatus(id: number, status: MatchStatus) {
|
||||||
const token = await getSessionData('token');
|
const token = await getSessionData('token');
|
||||||
|
|||||||
@@ -575,6 +575,8 @@
|
|||||||
|
|
||||||
&-action {
|
&-action {
|
||||||
margin-top: auto;
|
margin-top: auto;
|
||||||
|
display: flex;
|
||||||
|
gap: 10px
|
||||||
}
|
}
|
||||||
|
|
||||||
&-actions {
|
&-actions {
|
||||||
|
|||||||
@@ -18,7 +18,18 @@ 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';
|
||||||
|
|
||||||
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<React.SetStateAction<ViolationFileDetail | null>>,
|
||||||
|
}
|
||||||
|
) {
|
||||||
const t = useTranslations('Global');
|
const t = useTranslations('Global');
|
||||||
const tStatus = useTranslations('Match-status');
|
const tStatus = useTranslations('Match-status');
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
@@ -53,6 +64,13 @@ export default function FilePageViolationInfo({ selectedViolation, caseType }: {
|
|||||||
}
|
}
|
||||||
queryClient.invalidateQueries({ queryKey: ['fileViolations'] });
|
queryClient.invalidateQueries({ queryKey: ['fileViolations'] });
|
||||||
queryClient.invalidateQueries({ queryKey: ['complainInfo', id] });
|
queryClient.invalidateQueries({ queryKey: ['complainInfo', id] });
|
||||||
|
|
||||||
|
if (status === 'NOT_OWNER_FILE') {
|
||||||
|
console.log('NOT_OWNER_FILE');
|
||||||
|
setLocalViolation(null);
|
||||||
|
callBackSelectedViolation(null);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
setLocalViolation(selectedViolation);
|
setLocalViolation(selectedViolation);
|
||||||
@@ -311,6 +329,17 @@ export default function FilePageViolationInfo({ selectedViolation, caseType }: {
|
|||||||
<div
|
<div
|
||||||
className="violation-info-action"
|
className="violation-info-action"
|
||||||
>
|
>
|
||||||
|
<button
|
||||||
|
className="btn-s btn-resolve"
|
||||||
|
onClick={() => {
|
||||||
|
if (selectedViolation?.id) {
|
||||||
|
updateStatusHandler(selectedViolation.id, 'NOT_OWNER_FILE');
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
disabled={isUpdating}
|
||||||
|
>
|
||||||
|
{tStatus('NOT_OWNER_FILE')}
|
||||||
|
</button>
|
||||||
<button
|
<button
|
||||||
className="btn-s btn-resolve"
|
className="btn-s btn-resolve"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ export default function FilePageViolationsList({
|
|||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
{/* general info for match */}
|
{/* general info for match */}
|
||||||
<FilePageViolationInfo selectedViolation={selectedViolation} caseType={caseType} />
|
<FilePageViolationInfo selectedViolation={selectedViolation} caseType={caseType} callBackSelectedViolation={setSelectedViolation} />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{/* pagination */}
|
{/* pagination */}
|
||||||
|
|||||||
@@ -556,7 +556,8 @@
|
|||||||
"COMPLAINT_IN_WORK": "Complaint in work",
|
"COMPLAINT_IN_WORK": "Complaint in work",
|
||||||
"COMPLAINT_AND_LEGAL_IN_WORK": "Complaint and legal in work",
|
"COMPLAINT_AND_LEGAL_IN_WORK": "Complaint and legal in work",
|
||||||
"AUTHORIZED_USE": "Authorized use",
|
"AUTHORIZED_USE": "Authorized use",
|
||||||
"CREATED": "New"
|
"CREATED": "New",
|
||||||
|
"NOT_OWNER_FILE": "Not my file"
|
||||||
},
|
},
|
||||||
"Notifications": {
|
"Notifications": {
|
||||||
"notification-search-result": "Search result",
|
"notification-search-result": "Search result",
|
||||||
|
|||||||
@@ -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": "Новый"
|
"CREATED": "Новый",
|
||||||
|
"NOT_OWNER_FILE": "Не мой файл"
|
||||||
},
|
},
|
||||||
"Notifications": {
|
"Notifications": {
|
||||||
"notification-search-result": "Результат поиска",
|
"notification-search-result": "Результат поиска",
|
||||||
|
|||||||
Reference in New Issue
Block a user