mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-24 23:35:45 +00:00
Merge branch 'fix/adjustment-uniformity-ui' into 'development'
[FIX/FE] Adjustment Uniformity, Expense, Purchase, and Recording Page UI See merge request mbugroup/lti-web-client!304
This commit is contained in:
@@ -122,10 +122,18 @@ const ConfirmationModal = ({
|
|||||||
closeOnBackdrop={closeOnBackdrop}
|
closeOnBackdrop={closeOnBackdrop}
|
||||||
className={{
|
className={{
|
||||||
...className,
|
...className,
|
||||||
modalBox: cn('rounded-xl p-4', className?.modalBox),
|
modalBox: cn(
|
||||||
|
'rounded-xl p-4 flex flex-col gap-4 max-h-[90vh]',
|
||||||
|
className?.modalBox
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className='w-full flex flex-col gap-4'>
|
<div
|
||||||
|
className={cn(
|
||||||
|
'flex flex-col gap-4',
|
||||||
|
children && 'sticky top-0 bg-inherit z-10'
|
||||||
|
)}
|
||||||
|
>
|
||||||
{iconPosition === 'center' ? (
|
{iconPosition === 'center' ? (
|
||||||
<>
|
<>
|
||||||
<div className='w-fit mx-auto'>
|
<div className='w-fit mx-auto'>
|
||||||
@@ -164,17 +172,24 @@ const ConfirmationModal = ({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
{children && <div className='w-full'>{children}</div>}
|
{children && (
|
||||||
|
<div className='w-full flex-1 overflow-y-auto'>{children}</div>
|
||||||
|
)}
|
||||||
|
|
||||||
{(secondaryButton || primaryButton) && (
|
{(secondaryButton || primaryButton) && (
|
||||||
<div
|
<div
|
||||||
className={cn('w-full grid gap-3', {
|
className={cn(
|
||||||
|
'w-full grid gap-3',
|
||||||
|
children && 'sticky bottom-0 bg-inherit z-10',
|
||||||
|
{
|
||||||
'grid-cols-2': secondaryButton && primaryButton,
|
'grid-cols-2': secondaryButton && primaryButton,
|
||||||
'grid-cols-1':
|
'grid-cols-1':
|
||||||
(secondaryButton && !primaryButton) ||
|
(secondaryButton && !primaryButton) ||
|
||||||
(!secondaryButton && primaryButton),
|
(!secondaryButton && primaryButton),
|
||||||
})}
|
}
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
{secondaryButton && secondaryButton.text && (
|
{secondaryButton && secondaryButton.text && (
|
||||||
<Button
|
<Button
|
||||||
@@ -218,17 +233,13 @@ const ConfirmationModal = ({
|
|||||||
? primaryButton?.isLoading
|
? primaryButton?.isLoading
|
||||||
: isPrimaryButtonLoading
|
: isPrimaryButtonLoading
|
||||||
}
|
}
|
||||||
className={cn(
|
className={cn('p-2 rounded-xl text-sm', primaryButton?.className)}
|
||||||
'p-2 rounded-xl text-sm',
|
|
||||||
primaryButton?.className
|
|
||||||
)}
|
|
||||||
>
|
>
|
||||||
{primaryButton?.text ?? 'Ya'}
|
{primaryButton?.text ?? 'Ya'}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import PillBadge from '@/components/PillBadge';
|
import StatusBadge from '@/components/helper/StatusBadge';
|
||||||
|
|
||||||
import { BaseApproval } from '@/types/api/api-general';
|
import { BaseApproval } from '@/types/api/api-general';
|
||||||
|
import { Color } from '@/types/theme';
|
||||||
|
|
||||||
interface ExpenseStatusBadgeProps {
|
interface ExpenseStatusBadgeProps {
|
||||||
approval?: BaseApproval;
|
approval?: BaseApproval;
|
||||||
@@ -11,49 +12,45 @@ const ExpenseStatusBadge = ({ approval }: ExpenseStatusBadgeProps) => {
|
|||||||
|
|
||||||
const latestApprovalStepNumber = approval?.step_number;
|
const latestApprovalStepNumber = approval?.step_number;
|
||||||
|
|
||||||
let expenseStatusPillBadgeColor:
|
let expenseStatusBadgeColor: Color = 'neutral';
|
||||||
| 'yellow'
|
|
||||||
| 'green'
|
|
||||||
| 'gray'
|
|
||||||
| 'red'
|
|
||||||
| 'purple'
|
|
||||||
| 'blue' = 'gray';
|
|
||||||
|
|
||||||
switch (latestApprovalStepNumber) {
|
switch (latestApprovalStepNumber) {
|
||||||
case 1:
|
case 1:
|
||||||
expenseStatusPillBadgeColor = 'gray';
|
expenseStatusBadgeColor = 'neutral';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
expenseStatusPillBadgeColor = 'purple';
|
expenseStatusBadgeColor = 'info';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
expenseStatusPillBadgeColor = 'blue';
|
expenseStatusBadgeColor = 'warning';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
expenseStatusPillBadgeColor = 'yellow';
|
expenseStatusBadgeColor = 'error';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
expenseStatusPillBadgeColor = 'green';
|
expenseStatusBadgeColor = 'success';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
expenseStatusPillBadgeColor = 'green';
|
expenseStatusBadgeColor = 'success';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isLatestApprovalRejected) {
|
if (isLatestApprovalRejected) {
|
||||||
expenseStatusPillBadgeColor = 'red';
|
expenseStatusBadgeColor = 'error';
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PillBadge
|
<StatusBadge
|
||||||
content={isLatestApprovalRejected ? 'Ditolak' : approval?.step_name}
|
color={expenseStatusBadgeColor}
|
||||||
color={expenseStatusPillBadgeColor}
|
text={isLatestApprovalRejected ? 'Ditolak' : (approval?.step_name ?? '')}
|
||||||
className='text-xs'
|
className={{
|
||||||
|
badge: 'w-fit',
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -596,12 +596,11 @@ const ExpensesTable = () => {
|
|||||||
<RequirePermission permissions='lti.expense.create'>
|
<RequirePermission permissions='lti.expense.create'>
|
||||||
<Button
|
<Button
|
||||||
href='/expense/add'
|
href='/expense/add'
|
||||||
variant='outline'
|
|
||||||
color='primary'
|
color='primary'
|
||||||
className='w-full sm:w-fit'
|
className='px-3 py-2.5 w-fit text-sm text-base-100 rounded-lg shadow-sm'
|
||||||
>
|
>
|
||||||
<Icon icon='ic:round-plus' width={24} height={24} />
|
<Icon icon='heroicons:plus' width={20} height={20} />
|
||||||
Tambah
|
Add Expense
|
||||||
</Button>
|
</Button>
|
||||||
</RequirePermission>
|
</RequirePermission>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import PillBadge from '@/components/PillBadge';
|
import StatusBadge from '@/components/helper/StatusBadge';
|
||||||
|
|
||||||
import { BaseApproval } from '@/types/api/api-general';
|
import { BaseApproval } from '@/types/api/api-general';
|
||||||
|
import { Color } from '@/types/theme';
|
||||||
|
|
||||||
interface RealizationStatusBadgeProps {
|
interface RealizationStatusBadgeProps {
|
||||||
approval?: BaseApproval;
|
approval?: BaseApproval;
|
||||||
@@ -15,23 +16,21 @@ const RealizationStatusBadge = ({ approval }: RealizationStatusBadgeProps) => {
|
|||||||
? 'Sudah Realisasi'
|
? 'Sudah Realisasi'
|
||||||
: 'Belum Realisasi';
|
: 'Belum Realisasi';
|
||||||
|
|
||||||
let realizationStatusPillBadgeColor:
|
let realizationStatusBadgeColor: Color = isExpenseRealized
|
||||||
| 'yellow'
|
? 'success'
|
||||||
| 'green'
|
: 'warning';
|
||||||
| 'gray'
|
|
||||||
| 'red'
|
|
||||||
| 'purple'
|
|
||||||
| 'blue' = isExpenseRealized ? 'green' : 'yellow';
|
|
||||||
|
|
||||||
if (isLatestApprovalRejected) {
|
if (isLatestApprovalRejected) {
|
||||||
realizationStatusPillBadgeColor = 'red';
|
realizationStatusBadgeColor = 'error';
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PillBadge
|
<StatusBadge
|
||||||
content={isLatestApprovalRejected ? 'Ditolak' : realizationStatus}
|
color={realizationStatusBadgeColor}
|
||||||
color={realizationStatusPillBadgeColor}
|
text={isLatestApprovalRejected ? 'Ditolak' : realizationStatus}
|
||||||
className='text-xs'
|
className={{
|
||||||
|
badge: 'w-fit',
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -151,12 +151,11 @@ const MovementTable = () => {
|
|||||||
<RequirePermission permissions='lti.inventory.transfer.create'>
|
<RequirePermission permissions='lti.inventory.transfer.create'>
|
||||||
<Button
|
<Button
|
||||||
href='/inventory/movement/add'
|
href='/inventory/movement/add'
|
||||||
variant='outline'
|
|
||||||
color='primary'
|
color='primary'
|
||||||
className='w-full sm:w-fit'
|
className='px-3 py-2.5 w-fit text-sm text-base-100 rounded-lg shadow-sm'
|
||||||
>
|
>
|
||||||
<Icon icon='ic:round-plus' width={24} height={24} />
|
<Icon icon='heroicons:plus' width={20} height={20} />
|
||||||
Tambah
|
Add Movement
|
||||||
</Button>
|
</Button>
|
||||||
</RequirePermission>
|
</RequirePermission>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -380,12 +380,11 @@ const RecordingTable = () => {
|
|||||||
<RequirePermission permissions='lti.production.recording.create'>
|
<RequirePermission permissions='lti.production.recording.create'>
|
||||||
<Button
|
<Button
|
||||||
href='/production/recording/add'
|
href='/production/recording/add'
|
||||||
variant='outline'
|
|
||||||
color='primary'
|
color='primary'
|
||||||
className='w-full sm:w-fit'
|
className='px-3 py-2.5 w-fit text-sm text-base-100 rounded-lg shadow-sm'
|
||||||
>
|
>
|
||||||
<Icon icon='ic:round-plus' width={24} height={24} />
|
<Icon icon='heroicons:plus' width={20} height={20} />
|
||||||
Tambah
|
Add Recording
|
||||||
</Button>
|
</Button>
|
||||||
</RequirePermission>
|
</RequirePermission>
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ import {
|
|||||||
UpdateLayingRecordingPayload,
|
UpdateLayingRecordingPayload,
|
||||||
Recording,
|
Recording,
|
||||||
NextDayRecording,
|
NextDayRecording,
|
||||||
|
RecordingStock,
|
||||||
} from '@/types/api/production/recording';
|
} from '@/types/api/production/recording';
|
||||||
import { type BaseApiResponse } from '@/types/api/api-general';
|
import { type BaseApiResponse } from '@/types/api/api-general';
|
||||||
import {
|
import {
|
||||||
@@ -1103,14 +1104,51 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
[formik.values.stocks, type]
|
[formik.values.stocks, type]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const getStockPendingInfo = useCallback(
|
||||||
|
(productWarehouseId: number) => {
|
||||||
|
if ((type === 'edit' || type === 'detail') && initialValues?.stocks) {
|
||||||
|
const existingStock = initialValues.stocks.find(
|
||||||
|
(s) => s.product_warehouse_id === productWarehouseId
|
||||||
|
) as RecordingStock | undefined;
|
||||||
|
if (existingStock) {
|
||||||
|
return {
|
||||||
|
usageAmount: existingStock.usage_amount ?? 0,
|
||||||
|
pendingQty: existingStock.pending_qty ?? 0,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
usageAmount: 0,
|
||||||
|
pendingQty: 0,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
[initialValues, type]
|
||||||
|
);
|
||||||
|
|
||||||
const getStockUsageAdornment = useCallback(
|
const getStockUsageAdornment = useCallback(
|
||||||
(stockIdx: number) => {
|
(stockIdx: number) => {
|
||||||
if ((type as 'add' | 'edit' | 'detail') === 'detail') return null;
|
|
||||||
const stock = formik.values.stocks?.[stockIdx];
|
const stock = formik.values.stocks?.[stockIdx];
|
||||||
if (!stock || !stock.product_warehouse_id) return null;
|
if (!stock || !stock.product_warehouse_id) return null;
|
||||||
|
|
||||||
|
const isDetail = (type as 'add' | 'edit' | 'detail') === 'detail';
|
||||||
const availableStock = getAvailableStock(stock.product_warehouse_id);
|
const availableStock = getAvailableStock(stock.product_warehouse_id);
|
||||||
const requestedUsage = Number(stock.qty) || 0;
|
const requestedUsage = Number(stock.qty) || 0;
|
||||||
const remainingStock = availableStock - requestedUsage;
|
const remainingStock = availableStock - requestedUsage;
|
||||||
|
const { pendingQty } = getStockPendingInfo(stock.product_warehouse_id);
|
||||||
|
|
||||||
|
if (isDetail) {
|
||||||
|
if (pendingQty > 0) {
|
||||||
|
return (
|
||||||
|
<span className='text-sm text-gray-600 whitespace-nowrap'>
|
||||||
|
(tersedia: {formatNumber(requestedUsage)} | pending:{' '}
|
||||||
|
<span className='text-error'>{formatNumber(pendingQty)}</span> |
|
||||||
|
pakai: {formatNumber(requestedUsage + pendingQty)})
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (requestedUsage > 0) {
|
if (requestedUsage > 0) {
|
||||||
return (
|
return (
|
||||||
<span className='text-sm text-gray-600 whitespace-nowrap'>
|
<span className='text-sm text-gray-600 whitespace-nowrap'>
|
||||||
@@ -1127,7 +1165,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
[formik.values.stocks, getAvailableStock, type]
|
[formik.values.stocks, getAvailableStock, getStockPendingInfo, type]
|
||||||
);
|
);
|
||||||
|
|
||||||
const getProjectFlockBadgeAdornment = useCallback(() => {
|
const getProjectFlockBadgeAdornment = useCallback(() => {
|
||||||
@@ -2550,8 +2588,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
: null
|
: null
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{(type as 'add' | 'edit' | 'detail') !== 'detail' &&
|
{getStockUsageAdornment(idx)}
|
||||||
getStockUsageAdornment(idx)}
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
{(type as 'add' | 'edit' | 'detail') !== 'detail' && (
|
{(type as 'add' | 'edit' | 'detail') !== 'detail' && (
|
||||||
@@ -2604,6 +2641,8 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
{/* Depletions Table */}
|
{/* Depletions Table */}
|
||||||
|
{((type as 'add' | 'edit' | 'detail') !== 'detail' ||
|
||||||
|
(formik.values.depletions?.length ?? 0) > 0) && (
|
||||||
<Card
|
<Card
|
||||||
title='Deplesi'
|
title='Deplesi'
|
||||||
className={{
|
className={{
|
||||||
@@ -2685,11 +2724,13 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
value={
|
value={
|
||||||
depletionProducts.find(
|
depletionProducts.find(
|
||||||
(product) =>
|
(product) =>
|
||||||
product.value === depletion.product_warehouse_id
|
product.value ===
|
||||||
|
depletion.product_warehouse_id
|
||||||
) || null
|
) || null
|
||||||
}
|
}
|
||||||
onChange={(selectedOption) => {
|
onChange={(selectedOption) => {
|
||||||
const option = selectedOption as OptionType | null;
|
const option =
|
||||||
|
selectedOption as OptionType | null;
|
||||||
formik.setFieldValue(
|
formik.setFieldValue(
|
||||||
`depletions.${idx}.product_warehouse_id`,
|
`depletions.${idx}.product_warehouse_id`,
|
||||||
option?.value || 0
|
option?.value || 0
|
||||||
@@ -2802,9 +2843,13 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Card>
|
</Card>
|
||||||
|
)}
|
||||||
|
|
||||||
{/* Eggs Table - Only for LAYING Category */}
|
{/* Eggs Table - Only for LAYING Category */}
|
||||||
{isLayingCategory && (
|
{isLayingCategory &&
|
||||||
|
((type as 'add' | 'edit' | 'detail') !== 'detail' ||
|
||||||
|
((formik.values as RecordingLayingFormValues).eggs?.length ?? 0) >
|
||||||
|
0) && (
|
||||||
<Card
|
<Card
|
||||||
title='Telur'
|
title='Telur'
|
||||||
className={{
|
className={{
|
||||||
@@ -2821,10 +2866,10 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
<CheckboxInput
|
<CheckboxInput
|
||||||
name='select-all-eggs'
|
name='select-all-eggs'
|
||||||
checked={
|
checked={
|
||||||
((formik.values as RecordingLayingFormValues).eggs
|
((formik.values as RecordingLayingFormValues)
|
||||||
?.length ?? 0) === selectedEggs.length &&
|
.eggs?.length ?? 0) === selectedEggs.length &&
|
||||||
((formik.values as RecordingLayingFormValues).eggs
|
((formik.values as RecordingLayingFormValues)
|
||||||
?.length ?? 0) > 0
|
.eggs?.length ?? 0) > 0
|
||||||
}
|
}
|
||||||
onChange={(
|
onChange={(
|
||||||
e: React.ChangeEvent<HTMLInputElement>
|
e: React.ChangeEvent<HTMLInputElement>
|
||||||
@@ -2874,7 +2919,8 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
{(formik.values as RecordingLayingFormValues).eggs?.map(
|
{(formik.values as RecordingLayingFormValues).eggs?.map(
|
||||||
(egg, idx) => (
|
(egg, idx) => (
|
||||||
<tr key={`egg-${idx}`}>
|
<tr key={`egg-${idx}`}>
|
||||||
{(type as 'add' | 'edit' | 'detail') !== 'detail' && (
|
{(type as 'add' | 'edit' | 'detail') !==
|
||||||
|
'detail' && (
|
||||||
<td className='align-middle!'>
|
<td className='align-middle!'>
|
||||||
<CheckboxInput
|
<CheckboxInput
|
||||||
name={`egg-${idx}`}
|
name={`egg-${idx}`}
|
||||||
@@ -2950,7 +2996,8 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
thousandSeparator=','
|
thousandSeparator=','
|
||||||
decimalSeparator='.'
|
decimalSeparator='.'
|
||||||
isError={
|
isError={
|
||||||
isRepeaterInputError('eggs', 'qty', idx).isError
|
isRepeaterInputError('eggs', 'qty', idx)
|
||||||
|
.isError
|
||||||
}
|
}
|
||||||
errorMessage={
|
errorMessage={
|
||||||
isRepeaterInputError('eggs', 'qty', idx)
|
isRepeaterInputError('eggs', 'qty', idx)
|
||||||
@@ -2990,7 +3037,8 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
inputSuffix='Kilogram'
|
inputSuffix='Kilogram'
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
{(type as 'add' | 'edit' | 'detail') !== 'detail' && (
|
{(type as 'add' | 'edit' | 'detail') !==
|
||||||
|
'detail' && (
|
||||||
<td>
|
<td>
|
||||||
<div className='flex items-center'>
|
<div className='flex items-center'>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -1058,7 +1058,7 @@ const UniformityTable = () => {
|
|||||||
iconPosition='left'
|
iconPosition='left'
|
||||||
text='Data Berhasil Ditambahkan'
|
text='Data Berhasil Ditambahkan'
|
||||||
subtitleText='Data uniformity telah berhasil disimpan.'
|
subtitleText='Data uniformity telah berhasil disimpan.'
|
||||||
closeOnBackdrop={false}
|
closeOnBackdrop={true}
|
||||||
primaryButton={{
|
primaryButton={{
|
||||||
text: 'Ok',
|
text: 'Ok',
|
||||||
color: 'primary',
|
color: 'primary',
|
||||||
@@ -1089,6 +1089,7 @@ const UniformityTable = () => {
|
|||||||
ref={singleDeleteModal.ref}
|
ref={singleDeleteModal.ref}
|
||||||
type='error'
|
type='error'
|
||||||
iconPosition='left'
|
iconPosition='left'
|
||||||
|
closeOnBackdrop={true}
|
||||||
text={`Delete This Data?`}
|
text={`Delete This Data?`}
|
||||||
subtitleText='Are you sure you want to delete this data?'
|
subtitleText='Are you sure you want to delete this data?'
|
||||||
secondaryButton={{
|
secondaryButton={{
|
||||||
@@ -1113,6 +1114,7 @@ const UniformityTable = () => {
|
|||||||
ref={singleApproveModal.ref}
|
ref={singleApproveModal.ref}
|
||||||
type='success'
|
type='success'
|
||||||
iconPosition='left'
|
iconPosition='left'
|
||||||
|
closeOnBackdrop={true}
|
||||||
text='Approve This Submission?'
|
text='Approve This Submission?'
|
||||||
subtitleText='Are you sure you want to approve this submission?'
|
subtitleText='Are you sure you want to approve this submission?'
|
||||||
secondaryButton={{
|
secondaryButton={{
|
||||||
@@ -1129,15 +1131,12 @@ const UniformityTable = () => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className='flex flex-col gap-4'>
|
<div className='flex flex-col gap-4'>
|
||||||
{selectedRowIds.length === 1 ? (
|
{selectedUniformities.map((uniformity) => (
|
||||||
<UniformityConfirmationPreview
|
<UniformityConfirmationPreview
|
||||||
uniformity={selectedUniformities[0]}
|
key={uniformity.id}
|
||||||
|
uniformity={uniformity}
|
||||||
/>
|
/>
|
||||||
) : (
|
))}
|
||||||
<div className='text-center text-gray-500'>
|
|
||||||
{selectedRowIds.length} data dipilih
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</ConfirmationModal>
|
</ConfirmationModal>
|
||||||
|
|
||||||
@@ -1145,8 +1144,13 @@ const UniformityTable = () => {
|
|||||||
ref={bulkApproveModal.ref}
|
ref={bulkApproveModal.ref}
|
||||||
type='success'
|
type='success'
|
||||||
iconPosition='left'
|
iconPosition='left'
|
||||||
|
closeOnBackdrop={true}
|
||||||
text={`Approve This Submission?`}
|
text={`Approve This Submission?`}
|
||||||
subtitleText={`Are you sure you want to approve this submission? (${selectedRowIds.length} data)`}
|
subtitleText={
|
||||||
|
selectedRowIds.length === 1
|
||||||
|
? 'Are you sure you want to approve this submission?'
|
||||||
|
: `Are you sure you want to approve these submissions? (${selectedRowIds.length} data)`
|
||||||
|
}
|
||||||
secondaryButton={{
|
secondaryButton={{
|
||||||
text: 'Cancel',
|
text: 'Cancel',
|
||||||
}}
|
}}
|
||||||
@@ -1161,7 +1165,12 @@ const UniformityTable = () => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className='flex flex-col gap-4'>
|
<div className='flex flex-col gap-4'>
|
||||||
<UniformityConfirmationPreview uniformity={selectedUniformity} />
|
{selectedUniformities.map((uniformity) => (
|
||||||
|
<UniformityConfirmationPreview
|
||||||
|
key={uniformity.id}
|
||||||
|
uniformity={uniformity}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
</div>
|
</div>
|
||||||
</ConfirmationModal>
|
</ConfirmationModal>
|
||||||
|
|
||||||
@@ -1169,6 +1178,7 @@ const UniformityTable = () => {
|
|||||||
ref={singleRejectModal.ref}
|
ref={singleRejectModal.ref}
|
||||||
type='error'
|
type='error'
|
||||||
iconPosition='left'
|
iconPosition='left'
|
||||||
|
closeOnBackdrop={true}
|
||||||
text='Reject This Submission?'
|
text='Reject This Submission?'
|
||||||
subtitleText='Are you sure you want to reject this submission?'
|
subtitleText='Are you sure you want to reject this submission?'
|
||||||
secondaryButton={{
|
secondaryButton={{
|
||||||
@@ -1185,15 +1195,12 @@ const UniformityTable = () => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className='flex flex-col gap-4'>
|
<div className='flex flex-col gap-4'>
|
||||||
{selectedRowIds.length === 1 ? (
|
{selectedUniformities.map((uniformity) => (
|
||||||
<UniformityConfirmationPreview
|
<UniformityConfirmationPreview
|
||||||
uniformity={selectedUniformities[0]}
|
key={uniformity.id}
|
||||||
|
uniformity={uniformity}
|
||||||
/>
|
/>
|
||||||
) : (
|
))}
|
||||||
<div className='text-center text-gray-500'>
|
|
||||||
{selectedRowIds.length} data dipilih
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</ConfirmationModal>
|
</ConfirmationModal>
|
||||||
|
|
||||||
@@ -1201,8 +1208,13 @@ const UniformityTable = () => {
|
|||||||
ref={bulkRejectModal.ref}
|
ref={bulkRejectModal.ref}
|
||||||
type='error'
|
type='error'
|
||||||
iconPosition='left'
|
iconPosition='left'
|
||||||
|
closeOnBackdrop={true}
|
||||||
text={`Reject This Submission?`}
|
text={`Reject This Submission?`}
|
||||||
subtitleText={`Are you sure you want to reject this submission? (${selectedRowIds.length} data)`}
|
subtitleText={
|
||||||
|
selectedRowIds.length === 1
|
||||||
|
? 'Are you sure you want to reject this submission?'
|
||||||
|
: `Are you sure you want to reject these submissions? (${selectedRowIds.length} data)`
|
||||||
|
}
|
||||||
secondaryButton={{
|
secondaryButton={{
|
||||||
text: 'Cancel',
|
text: 'Cancel',
|
||||||
}}
|
}}
|
||||||
@@ -1217,15 +1229,12 @@ const UniformityTable = () => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className='flex flex-col gap-4'>
|
<div className='flex flex-col gap-4'>
|
||||||
{selectedRowIds.length === 1 ? (
|
{selectedUniformities.map((uniformity) => (
|
||||||
<UniformityConfirmationPreview
|
<UniformityConfirmationPreview
|
||||||
uniformity={selectedUniformities[0]}
|
key={uniformity.id}
|
||||||
|
uniformity={uniformity}
|
||||||
/>
|
/>
|
||||||
) : (
|
))}
|
||||||
<div className='text-center text-gray-500'>
|
|
||||||
{selectedRowIds.length} data dipilih
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</ConfirmationModal>
|
</ConfirmationModal>
|
||||||
|
|
||||||
|
|||||||
@@ -319,12 +319,11 @@ const PurchaseTable = () => {
|
|||||||
<RequirePermission permissions='lti.purchase.create'>
|
<RequirePermission permissions='lti.purchase.create'>
|
||||||
<Button
|
<Button
|
||||||
href='/purchase/add'
|
href='/purchase/add'
|
||||||
variant='outline'
|
|
||||||
color='primary'
|
color='primary'
|
||||||
className='w-full sm:w-fit'
|
className='px-3 py-2.5 w-fit text-sm text-base-100 rounded-lg shadow-sm'
|
||||||
>
|
>
|
||||||
<Icon icon='ic:round-plus' width={24} height={24} />
|
<Icon icon='heroicons:plus' width={20} height={20} />
|
||||||
Tambah
|
Add Purchase
|
||||||
</Button>
|
</Button>
|
||||||
</RequirePermission>
|
</RequirePermission>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user