mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 07:45:47 +00:00
chore: prettier format
This commit is contained in:
+11
-12
@@ -10,15 +10,15 @@ stages:
|
|||||||
paths:
|
paths:
|
||||||
- node_modules/
|
- node_modules/
|
||||||
variables:
|
variables:
|
||||||
NPM_CONFIG_PRODUCTION: "false"
|
NPM_CONFIG_PRODUCTION: 'false'
|
||||||
NODE_ENV: ""
|
NODE_ENV: ''
|
||||||
script:
|
script:
|
||||||
- echo "Installing dependencies..."
|
- echo "Installing dependencies..."
|
||||||
- npm ci --no-audit --no-fund
|
- npm ci --no-audit --no-fund
|
||||||
- echo "Building Next.js static export..."
|
- echo "Building Next.js static export..."
|
||||||
- npx next build
|
- npx next build
|
||||||
artifacts:
|
artifacts:
|
||||||
name: "out-$CI_COMMIT_SHORT_SHA"
|
name: 'out-$CI_COMMIT_SHORT_SHA'
|
||||||
paths:
|
paths:
|
||||||
- out/
|
- out/
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
@@ -27,7 +27,7 @@ stages:
|
|||||||
stage: deploy
|
stage: deploy
|
||||||
image:
|
image:
|
||||||
name: amazon/aws-cli:latest
|
name: amazon/aws-cli:latest
|
||||||
entrypoint: ["/bin/sh", "-c"]
|
entrypoint: ['/bin/sh', '-c']
|
||||||
script:
|
script:
|
||||||
- set -e
|
- set -e
|
||||||
- aws --version
|
- aws --version
|
||||||
@@ -106,22 +106,21 @@ build:dev:
|
|||||||
environment:
|
environment:
|
||||||
name: development
|
name: development
|
||||||
variables:
|
variables:
|
||||||
NEXT_PUBLIC_API_BASE_URL: "https://dev-api-lti.mbugroup.id"
|
NEXT_PUBLIC_API_BASE_URL: 'https://dev-api-lti.mbugroup.id'
|
||||||
NEXT_PUBLIC_SSO_LOGIN_URL: "https://dev-api-sso.mbugroup.id"
|
NEXT_PUBLIC_SSO_LOGIN_URL: 'https://dev-api-sso.mbugroup.id'
|
||||||
|
|
||||||
deploy:dev:
|
deploy:dev:
|
||||||
<<: *deploy_template
|
<<: *deploy_template
|
||||||
needs: ["build:dev"]
|
needs: ['build:dev']
|
||||||
rules:
|
rules:
|
||||||
- if: '$CI_COMMIT_BRANCH == "development"'
|
- if: '$CI_COMMIT_BRANCH == "development"'
|
||||||
variables:
|
variables:
|
||||||
S3_BUCKET: "dev-lti-erp.mbugroup.id"
|
S3_BUCKET: 'dev-lti-erp.mbugroup.id'
|
||||||
AWS_REGION: "ap-southeast-3"
|
AWS_REGION: 'ap-southeast-3'
|
||||||
CLOUDFRONT_DISTRIBUTION_ID: "E1Z8XTA8XF1GIV"
|
CLOUDFRONT_DISTRIBUTION_ID: 'E1Z8XTA8XF1GIV'
|
||||||
environment:
|
environment:
|
||||||
name: development
|
name: development
|
||||||
url: https://dev-lti-erp.mbugroup.id
|
url: https://dev-lti-erp.mbugroup.id
|
||||||
|
|
||||||
# ====== PRODUCTION ======
|
# ====== PRODUCTION ======
|
||||||
# build:production:
|
# build:production:
|
||||||
# <<: *build_template
|
# <<: *build_template
|
||||||
@@ -143,5 +142,5 @@ deploy:dev:
|
|||||||
# CLOUDFRONT_DISTRIBUTION_ID: "ddfd"
|
# CLOUDFRONT_DISTRIBUTION_ID: "ddfd"
|
||||||
# environment:
|
# environment:
|
||||||
# name: production
|
# name: production
|
||||||
# url: https://royalgoldcapital.com
|
# url: https://royalgoldcapital.com
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -1,4 +1,4 @@
|
|||||||
version: "3.9"
|
version: '3.9'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
dev-web-lti:
|
dev-web-lti:
|
||||||
@@ -7,7 +7,7 @@ services:
|
|||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
ports:
|
ports:
|
||||||
- "3002:3000"
|
- '3002:3000'
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
environment:
|
environment:
|
||||||
@@ -19,13 +19,13 @@ services:
|
|||||||
deploy:
|
deploy:
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpus: "3.0"
|
cpus: '3.0'
|
||||||
memory: 3G
|
memory: 3G
|
||||||
reservations:
|
reservations:
|
||||||
cpus: "1.0"
|
cpus: '1.0'
|
||||||
memory: 512M
|
memory: 512M
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
- "host.docker.internal:host-gateway"
|
- 'host.docker.internal:host-gateway'
|
||||||
# Optional: aktifkan healthcheck jika punya endpoint
|
# Optional: aktifkan healthcheck jika punya endpoint
|
||||||
# healthcheck:
|
# healthcheck:
|
||||||
# test: ["CMD-SHELL", "curl -fsS http://localhost:3000/api/healthz || exit 1"]
|
# test: ["CMD-SHELL", "curl -fsS http://localhost:3000/api/healthz || exit 1"]
|
||||||
|
|||||||
@@ -35,7 +35,12 @@ const AddGrading = () => {
|
|||||||
{(!recordingId ||
|
{(!recordingId ||
|
||||||
recordingId === 'new' ||
|
recordingId === 'new' ||
|
||||||
(!isLoadingRecording && recording && isResponseSuccess(recording))) && (
|
(!isLoadingRecording && recording && isResponseSuccess(recording))) && (
|
||||||
<GradingForm type='add' initialValues={isResponseSuccess(recording) ? recording.data?.eggs?.[0] : undefined} />
|
<GradingForm
|
||||||
|
type='add'
|
||||||
|
initialValues={
|
||||||
|
isResponseSuccess(recording) ? recording.data?.eggs?.[0] : undefined
|
||||||
|
}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -64,44 +64,46 @@ export const FormActions = <T,>({
|
|||||||
Edit
|
Edit
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
{type === 'detail' && showApproveReject && (onApprove || onReject) && (
|
{type === 'detail' &&
|
||||||
<>
|
showApproveReject &&
|
||||||
{onApprove && (
|
(onApprove || onReject) && (
|
||||||
<Button
|
<>
|
||||||
type='button'
|
{onApprove && (
|
||||||
color='success'
|
<Button
|
||||||
onClick={onApprove}
|
type='button'
|
||||||
className='px-4'
|
color='success'
|
||||||
isLoading={isApproveLoading}
|
onClick={onApprove}
|
||||||
>
|
className='px-4'
|
||||||
<Icon
|
isLoading={isApproveLoading}
|
||||||
icon='material-symbols:check-circle-outline'
|
>
|
||||||
width={24}
|
<Icon
|
||||||
height={24}
|
icon='material-symbols:check-circle-outline'
|
||||||
className='justify-start text-sm'
|
width={24}
|
||||||
/>
|
height={24}
|
||||||
Approve
|
className='justify-start text-sm'
|
||||||
</Button>
|
/>
|
||||||
)}
|
Approve
|
||||||
{onReject && (
|
</Button>
|
||||||
<Button
|
)}
|
||||||
type='button'
|
{onReject && (
|
||||||
color='error'
|
<Button
|
||||||
onClick={onReject}
|
type='button'
|
||||||
className='px-4'
|
color='error'
|
||||||
isLoading={isRejectLoading}
|
onClick={onReject}
|
||||||
>
|
className='px-4'
|
||||||
<Icon
|
isLoading={isRejectLoading}
|
||||||
icon='material-symbols:cancel-outline'
|
>
|
||||||
width={24}
|
<Icon
|
||||||
height={24}
|
icon='material-symbols:cancel-outline'
|
||||||
className='justify-start text-sm'
|
width={24}
|
||||||
/>
|
height={24}
|
||||||
Reject
|
className='justify-start text-sm'
|
||||||
</Button>
|
/>
|
||||||
)}
|
Reject
|
||||||
</>
|
</Button>
|
||||||
)}
|
)}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{type !== 'detail' && (
|
{type !== 'detail' && (
|
||||||
|
|||||||
@@ -20,14 +20,14 @@ interface PatternInputProps extends Omit<TextInputProps, 'type'> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const PatternInput = ({
|
const PatternInput = ({
|
||||||
type = 'text',
|
type = 'text',
|
||||||
format,
|
format,
|
||||||
mask = '_',
|
mask = '_',
|
||||||
allowEmptyFormatting = false,
|
allowEmptyFormatting = false,
|
||||||
patternChar = '#',
|
patternChar = '#',
|
||||||
onChange,
|
onChange,
|
||||||
...restProps
|
...restProps
|
||||||
}: PatternInputProps) => {
|
}: PatternInputProps) => {
|
||||||
const valueChangeHandler: OnValueChange = (
|
const valueChangeHandler: OnValueChange = (
|
||||||
patternFormatValues,
|
patternFormatValues,
|
||||||
sourceInfo
|
sourceInfo
|
||||||
|
|||||||
@@ -150,36 +150,37 @@ const DeliveryObjectSchema: Yup.ObjectSchema<DeliverySchema> = Yup.object({
|
|||||||
.required('Produk wajib diisi!'),
|
.required('Produk wajib diisi!'),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const MovementFormSchema: Yup.ObjectSchema<MovementFormSchemaType> = Yup.object({
|
export const MovementFormSchema: Yup.ObjectSchema<MovementFormSchemaType> =
|
||||||
transfer_reason: Yup.string().required('Alasan transfer wajib diisi!'),
|
Yup.object({
|
||||||
transfer_date: Yup.string().required('Tanggal transfer wajib diisi!'),
|
transfer_reason: Yup.string().required('Alasan transfer wajib diisi!'),
|
||||||
source_warehouse: Yup.object({
|
transfer_date: Yup.string().required('Tanggal transfer wajib diisi!'),
|
||||||
value: Yup.number().min(1).required(),
|
source_warehouse: Yup.object({
|
||||||
label: Yup.string().required(),
|
value: Yup.number().min(1).required(),
|
||||||
area: Yup.string().optional(),
|
label: Yup.string().required(),
|
||||||
location: Yup.string().optional(),
|
area: Yup.string().optional(),
|
||||||
}).nullable(),
|
location: Yup.string().optional(),
|
||||||
source_warehouse_id: Yup.number()
|
}).nullable(),
|
||||||
.required('Gudang asal wajib diisi!')
|
source_warehouse_id: Yup.number()
|
||||||
.typeError('Gudang asal wajib diisi!'),
|
.required('Gudang asal wajib diisi!')
|
||||||
destination_warehouse: Yup.object({
|
.typeError('Gudang asal wajib diisi!'),
|
||||||
value: Yup.number().min(1).required(),
|
destination_warehouse: Yup.object({
|
||||||
label: Yup.string().required(),
|
value: Yup.number().min(1).required(),
|
||||||
area: Yup.string().optional(),
|
label: Yup.string().required(),
|
||||||
location: Yup.string().optional(),
|
area: Yup.string().optional(),
|
||||||
}).nullable(),
|
location: Yup.string().optional(),
|
||||||
destination_warehouse_id: Yup.number()
|
}).nullable(),
|
||||||
.required('Gudang tujuan wajib diisi!')
|
destination_warehouse_id: Yup.number()
|
||||||
.typeError('Gudang tujuan wajib diisi!'),
|
.required('Gudang tujuan wajib diisi!')
|
||||||
products: Yup.array()
|
.typeError('Gudang tujuan wajib diisi!'),
|
||||||
.of(ProductObjectSchema)
|
products: Yup.array()
|
||||||
.min(1, 'Minimal harus ada 1 produk!')
|
.of(ProductObjectSchema)
|
||||||
.required('Produk wajib diisi!'),
|
.min(1, 'Minimal harus ada 1 produk!')
|
||||||
deliveries: Yup.array()
|
.required('Produk wajib diisi!'),
|
||||||
.of(DeliveryObjectSchema)
|
deliveries: Yup.array()
|
||||||
.min(1, 'Minimal harus ada 1 pengiriman!')
|
.of(DeliveryObjectSchema)
|
||||||
.required('Pengiriman wajib diisi!'),
|
.min(1, 'Minimal harus ada 1 pengiriman!')
|
||||||
});
|
.required('Pengiriman wajib diisi!'),
|
||||||
|
});
|
||||||
|
|
||||||
export type MovementFormValues = Yup.InferType<typeof MovementFormSchema>;
|
export type MovementFormValues = Yup.InferType<typeof MovementFormSchema>;
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -15,4 +15,6 @@ export const ProductCategoryFormSchema: Yup.ObjectSchema<ProductCategoryFormSche
|
|||||||
|
|
||||||
export const UpdateProductCategoryFormSchema = ProductCategoryFormSchema;
|
export const UpdateProductCategoryFormSchema = ProductCategoryFormSchema;
|
||||||
|
|
||||||
export type ProductCategoryFormValues = Yup.InferType<typeof ProductCategoryFormSchema>;
|
export type ProductCategoryFormValues = Yup.InferType<
|
||||||
|
typeof ProductCategoryFormSchema
|
||||||
|
>;
|
||||||
|
|||||||
@@ -31,7 +31,9 @@ export const ProductFormSchema: Yup.ObjectSchema<ProductFormSchemaType> =
|
|||||||
uom: Yup.object({
|
uom: Yup.object({
|
||||||
value: Yup.number().min(1).required(),
|
value: Yup.number().min(1).required(),
|
||||||
label: Yup.string().required(),
|
label: Yup.string().required(),
|
||||||
}).nullable().required('Satuan wajib diisi!'),
|
})
|
||||||
|
.nullable()
|
||||||
|
.required('Satuan wajib diisi!'),
|
||||||
|
|
||||||
uom_id: Yup.number()
|
uom_id: Yup.number()
|
||||||
.required('Satuan wajib diisi!')
|
.required('Satuan wajib diisi!')
|
||||||
@@ -40,7 +42,9 @@ export const ProductFormSchema: Yup.ObjectSchema<ProductFormSchemaType> =
|
|||||||
product_category: Yup.object({
|
product_category: Yup.object({
|
||||||
value: Yup.number().min(1).required(),
|
value: Yup.number().min(1).required(),
|
||||||
label: Yup.string().required(),
|
label: Yup.string().required(),
|
||||||
}).nullable().required('Kategori produk wajib diisi!'),
|
})
|
||||||
|
.nullable()
|
||||||
|
.required('Kategori produk wajib diisi!'),
|
||||||
|
|
||||||
product_category_id: Yup.number()
|
product_category_id: Yup.number()
|
||||||
.required('Kategori produk wajib diisi!')
|
.required('Kategori produk wajib diisi!')
|
||||||
|
|||||||
@@ -121,9 +121,7 @@ const ProductForm = ({ type = 'add', initialValues }: ProductFormProps) => {
|
|||||||
supplier_ids: values.supplier_ids.filter(
|
supplier_ids: values.supplier_ids.filter(
|
||||||
(id): id is number => typeof id === 'number'
|
(id): id is number => typeof id === 'number'
|
||||||
),
|
),
|
||||||
flags: values.flags.filter(
|
flags: values.flags.filter((f): f is string => typeof f === 'string'),
|
||||||
(f): f is string => typeof f === 'string'
|
|
||||||
),
|
|
||||||
};
|
};
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'add':
|
case 'add':
|
||||||
|
|||||||
@@ -236,7 +236,9 @@ export type RecordingGradingFormValues = Yup.InferType<
|
|||||||
type RecordingFormData = Partial<Recording> & {
|
type RecordingFormData = Partial<Recording> & {
|
||||||
body_weights?: CreateGrowingRecordingPayload['body_weights'];
|
body_weights?: CreateGrowingRecordingPayload['body_weights'];
|
||||||
stocks?: CreateGrowingRecordingPayload['stocks'] | Recording['stocks'];
|
stocks?: CreateGrowingRecordingPayload['stocks'] | Recording['stocks'];
|
||||||
depletions?: CreateGrowingRecordingPayload['depletions'] | Recording['depletions'];
|
depletions?:
|
||||||
|
| CreateGrowingRecordingPayload['depletions']
|
||||||
|
| Recording['depletions'];
|
||||||
eggs?: CreateLayingRecordingPayload['eggs'] | Recording['eggs'];
|
eggs?: CreateLayingRecordingPayload['eggs'] | Recording['eggs'];
|
||||||
project_flock_kandang_id?: number;
|
project_flock_kandang_id?: number;
|
||||||
project_flock_category?: string;
|
project_flock_category?: string;
|
||||||
@@ -268,14 +270,17 @@ export const getRecordingGrowingFormInitialValues = (
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
stocks: initialValues?.stocks?.map((stock) => ({
|
stocks: initialValues?.stocks?.map((stock) => ({
|
||||||
product_warehouse_id: stock.product_warehouse_id,
|
product_warehouse_id: stock.product_warehouse_id,
|
||||||
qty: (stock as { qty?: number; usage_amount?: number }).qty || (stock as { qty?: number; usage_amount?: number }).usage_amount || '',
|
qty:
|
||||||
})) ?? [
|
(stock as { qty?: number; usage_amount?: number }).qty ||
|
||||||
{
|
(stock as { qty?: number; usage_amount?: number }).usage_amount ||
|
||||||
product_warehouse_id: 0,
|
'',
|
||||||
qty: '',
|
})) ?? [
|
||||||
},
|
{
|
||||||
],
|
product_warehouse_id: 0,
|
||||||
|
qty: '',
|
||||||
|
},
|
||||||
|
],
|
||||||
depletions: initialValues?.depletions?.map(
|
depletions: initialValues?.depletions?.map(
|
||||||
(
|
(
|
||||||
depletion: NonNullable<CreateGrowingRecordingPayload['depletions']>[0]
|
depletion: NonNullable<CreateGrowingRecordingPayload['depletions']>[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user