mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
Merge branch 'development' into 'production'
Development See merge request mbugroup/lti-web-client!356
This commit is contained in:
@@ -603,10 +603,11 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
options: stockProductOptions,
|
options: stockProductOptions,
|
||||||
|
setInputValue: setStockProductInputValue,
|
||||||
rawData: stockProducts,
|
rawData: stockProducts,
|
||||||
isLoadingOptions: isLoadingStockProducts,
|
isLoadingOptions: isLoadingStockProducts,
|
||||||
loadMore: loadMoreStockProducts,
|
loadMore: loadMoreStockProducts,
|
||||||
} = useSelect(ProductWarehouseApi.basePath, 'id', 'product.name', '', {
|
} = useSelect(ProductWarehouseApi.basePath, 'id', 'product.name', 'search', {
|
||||||
flags: 'PAKAN,OVK',
|
flags: 'PAKAN,OVK',
|
||||||
location_id: stockProductsLocationId,
|
location_id: stockProductsLocationId,
|
||||||
kandang_id: stockProductsKandangId,
|
kandang_id: stockProductsKandangId,
|
||||||
@@ -2665,6 +2666,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
product.value === stock.product_warehouse_id
|
product.value === stock.product_warehouse_id
|
||||||
) || null
|
) || null
|
||||||
}
|
}
|
||||||
|
onInputChange={setStockProductInputValue}
|
||||||
onChange={(selectedOption) => {
|
onChange={(selectedOption) => {
|
||||||
const option =
|
const option =
|
||||||
selectedOption as OptionType | null;
|
selectedOption as OptionType | null;
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ export function ListDailyChecklistContent() {
|
|||||||
|
|
||||||
const handleEdit = (item: DailyChecklist) => {
|
const handleEdit = (item: DailyChecklist) => {
|
||||||
const formattedDate = new Date(item.date).toISOString().split('T')[0];
|
const formattedDate = new Date(item.date).toISOString().split('T')[0];
|
||||||
const kandangId = item.kandang.id;
|
const kandangId = item.kandang?.id ?? '';
|
||||||
const category = item.category;
|
const category = item.category;
|
||||||
|
|
||||||
router.push(
|
router.push(
|
||||||
@@ -335,7 +335,7 @@ export function ListDailyChecklistContent() {
|
|||||||
accessorKey: 'kandang',
|
accessorKey: 'kandang',
|
||||||
header: 'Kandang',
|
header: 'Kandang',
|
||||||
enableSorting: false,
|
enableSorting: false,
|
||||||
cell: ({ row }) => row.original.kandang.name,
|
cell: ({ row }) => row.original.kandang?.name ?? '-',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorKey: 'category',
|
accessorKey: 'category',
|
||||||
@@ -627,7 +627,7 @@ export function ListDailyChecklistContent() {
|
|||||||
<div className='flex justify-between text-sm'>
|
<div className='flex justify-between text-sm'>
|
||||||
<span className='text-gray-600'>Kandang:</span>
|
<span className='text-gray-600'>Kandang:</span>
|
||||||
<span className='font-medium text-gray-900'>
|
<span className='font-medium text-gray-900'>
|
||||||
{selectedItem.kandang.name}
|
{selectedItem.kandang?.name ?? '-'}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className='flex justify-between text-sm'>
|
<div className='flex justify-between text-sm'>
|
||||||
@@ -687,7 +687,7 @@ export function ListDailyChecklistContent() {
|
|||||||
<div className='flex justify-between text-sm'>
|
<div className='flex justify-between text-sm'>
|
||||||
<span className='text-gray-600'>Kandang:</span>
|
<span className='text-gray-600'>Kandang:</span>
|
||||||
<span className='font-medium text-gray-900'>
|
<span className='font-medium text-gray-900'>
|
||||||
{selectedItem.kandang.name}
|
{selectedItem.kandang?.name ?? '-'}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className='flex justify-between text-sm'>
|
<div className='flex justify-between text-sm'>
|
||||||
@@ -760,7 +760,7 @@ export function ListDailyChecklistContent() {
|
|||||||
<div className='flex justify-between text-sm'>
|
<div className='flex justify-between text-sm'>
|
||||||
<span className='text-gray-600'>Kandang:</span>
|
<span className='text-gray-600'>Kandang:</span>
|
||||||
<span className='font-medium text-gray-900'>
|
<span className='font-medium text-gray-900'>
|
||||||
{selectedItem.kandang.name}
|
{selectedItem.kandang?.name ?? '-'}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className='flex justify-between text-sm'>
|
<div className='flex justify-between text-sm'>
|
||||||
|
|||||||
+1
-1
@@ -172,7 +172,7 @@ export function DetailDailyChecklistContent() {
|
|||||||
const checklistData = {
|
const checklistData = {
|
||||||
id: rawDetailChecklist?.id,
|
id: rawDetailChecklist?.id,
|
||||||
date: rawDetailChecklist?.date,
|
date: rawDetailChecklist?.date,
|
||||||
kandang_id: rawDetailChecklist?.kandang.id,
|
kandang_id: rawDetailChecklist?.kandang?.id,
|
||||||
category: rawDetailChecklist?.category,
|
category: rawDetailChecklist?.category,
|
||||||
status: rawDetailChecklist?.status,
|
status: rawDetailChecklist?.status,
|
||||||
reject_reason: rawDetailChecklist?.reject_reason,
|
reject_reason: rawDetailChecklist?.reject_reason,
|
||||||
|
|||||||
@@ -10,7 +10,10 @@ const axiosClient = axios.create({ baseURL: BASE_URL, timeout: 10_000 });
|
|||||||
axiosClient.interceptors.response.use(
|
axiosClient.interceptors.response.use(
|
||||||
(response) => response,
|
(response) => response,
|
||||||
(error: AxiosError) => {
|
(error: AxiosError) => {
|
||||||
if (error.response?.status === 401) {
|
if (
|
||||||
|
error.response?.status === 401 &&
|
||||||
|
error.config?.url !== '/sso/refresh'
|
||||||
|
) {
|
||||||
redirectToSSO();
|
redirectToSSO();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ export type BaseDailyChecklist = {
|
|||||||
status: string;
|
status: string;
|
||||||
category: string;
|
category: string;
|
||||||
date: string;
|
date: string;
|
||||||
kandang: Pick<BaseKandang, 'id' | 'name' | 'status' | 'capacity'>;
|
kandang?: Pick<BaseKandang, 'id' | 'name' | 'status' | 'capacity'>;
|
||||||
total_phase: number;
|
total_phase: number;
|
||||||
total_activity: number;
|
total_activity: number;
|
||||||
progress: number;
|
progress: number;
|
||||||
|
|||||||
Reference in New Issue
Block a user