From 8fa2a444f0ae455d19dce59a0d79b8d4397f3620 Mon Sep 17 00:00:00 2001
From: kris
Date: Mon, 2 Feb 2026 03:42:31 +0000
Subject: [PATCH 1/4] Update .gitlab-ci.yml file
---
.gitlab-ci.yml | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e80a7e02..cfef03d0 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -26,14 +26,23 @@ default:
script:
- echo "Installing dependencies..."
- npm ci --no-audit --no-fund
+
- echo "Build env used:"
- echo "NEXT_PUBLIC_LTI_URL=$NEXT_PUBLIC_LTI_URL"
- echo "NEXT_PUBLIC_SSO_LOGIN_URL=$NEXT_PUBLIC_SSO_LOGIN_URL"
- echo "NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL"
- - echo "Building Next.js static export..."
+ - echo "NEXT_PUBLIC_CLIENT_ID=$NEXT_PUBLIC_CLIENT_ID"
+
+ # โ
Build Next
+ - echo "Building Next.js..."
- npx next build
+
+ # โ
Export static to out/ (ini yang sebelumnya missing)
+ - echo "Exporting Next.js static site to ./out ..."
+ - npx next export -o out
+
+ # build-info.json tetap kamu simpan di out/
- |
- mkdir -p out
cat < out/build-info.json
{
"commit": "$CI_COMMIT_SHORT_SHA",
@@ -41,9 +50,17 @@ default:
"built_at": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")",
"NEXT_PUBLIC_LTI_URL": "$NEXT_PUBLIC_LTI_URL",
"NEXT_PUBLIC_SSO_LOGIN_URL": "$NEXT_PUBLIC_SSO_LOGIN_URL",
- "NEXT_PUBLIC_API_BASE_URL": "$NEXT_PUBLIC_API_BASE_URL"
+ "NEXT_PUBLIC_API_BASE_URL": "$NEXT_PUBLIC_API_BASE_URL",
+ "NEXT_PUBLIC_CLIENT_ID": "$NEXT_PUBLIC_CLIENT_ID"
}
EOF
+
+ # โ
Verifikasi cepat (biar ketahuan out/ isinya bener)
+ - echo "===== out/ preview ====="
+ - ls -lah out | head -n 50
+ - echo "===== _next assets preview ====="
+ - ls -lah out/_next/static/chunks 2>/dev/null | head -n 30 || true
+
artifacts:
name: 'out-$CI_COMMIT_SHORT_SHA'
paths:
From 995d20bdf354ef1720bc3ebc09b7dec083c02fdb Mon Sep 17 00:00:00 2001
From: ValdiANS
Date: Mon, 2 Feb 2026 10:54:34 +0700
Subject: [PATCH 2/4] chore: implement permission guard for edit,
approve/reject, and delete button
---
.../ListDailyChecklistContent.tsx | 45 ++++++++++---------
1 file changed, 25 insertions(+), 20 deletions(-)
diff --git a/src/figma-make/components/pages/list-daily-checklist/ListDailyChecklistContent.tsx b/src/figma-make/components/pages/list-daily-checklist/ListDailyChecklistContent.tsx
index f54ad41f..634d8716 100644
--- a/src/figma-make/components/pages/list-daily-checklist/ListDailyChecklistContent.tsx
+++ b/src/figma-make/components/pages/list-daily-checklist/ListDailyChecklistContent.tsx
@@ -36,6 +36,7 @@ import { ColumnDef } from '@tanstack/react-table';
import { useSelect } from '@/components/input/SelectInput';
import { KandangApi } from '@/services/api/master-data';
import DebouncedTextInput from '@/components/input/DebouncedTextInput';
+import RequirePermission from '@/components/helper/RequirePermission';
interface Kandang {
id: string;
@@ -389,19 +390,21 @@ export function ListDailyChecklistContent() {
{row.original.status === 'DRAFT' && (
-
+
+
+
)}
{row.original.status === 'SUBMITTED' && (
- <>
+
- >
+
)}
{row.original.status === 'DRAFT' && (
-
+
+
+
)}
),
From 448cf5ceae71b73f8cff47278e8f6ea4dde0a103 Mon Sep 17 00:00:00 2001
From: kris
Date: Mon, 2 Feb 2026 03:57:20 +0000
Subject: [PATCH 3/4] Update .gitlab-ci.yml file
---
.gitlab-ci.yml | 47 +++++++++++++++++++++++++++--------------------
1 file changed, 27 insertions(+), 20 deletions(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index cfef03d0..9bdfffa4 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -16,32 +16,46 @@ default:
.build_template: &build_template
stage: build
image: node:20-alpine
+
cache:
key: npm-cache
paths:
- node_modules/
+
variables:
- NPM_CONFIG_PRODUCTION: 'false'
- NODE_ENV: ''
+ NODE_ENV: ""
+ NPM_CONFIG_PRODUCTION: "false"
+
script:
- - echo "Installing dependencies..."
+ # Install dependencies
+ - echo "๐ฆ Installing dependencies..."
- npm ci --no-audit --no-fund
- - echo "Build env used:"
+ # Print env used
+ - echo "โ
Build env used:"
- echo "NEXT_PUBLIC_LTI_URL=$NEXT_PUBLIC_LTI_URL"
- echo "NEXT_PUBLIC_SSO_LOGIN_URL=$NEXT_PUBLIC_SSO_LOGIN_URL"
- echo "NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL"
- - echo "NEXT_PUBLIC_CLIENT_ID=$NEXT_PUBLIC_CLIENT_ID"
- # โ
Build Next
- - echo "Building Next.js..."
+ # Clean old output
+ - echo "๐งน Cleaning old build..."
+ - rm -rf .next out
+
+ # Build Next.js
+ - echo "๐๏ธ Running Next.js build..."
- npx next build
- # โ
Export static to out/ (ini yang sebelumnya missing)
- - echo "Exporting Next.js static site to ./out ..."
- - npx next export -o out
+ # Export static site
+ - echo "๐ค Exporting static site..."
+ - npx next export
- # build-info.json tetap kamu simpan di out/
+ # Validate export result
+ - echo "๐ Validating export output..."
+ - test -f out/index.html || (echo "โ out/index.html missing" && exit 1)
+ - test -d out/_next/static || (echo "โ out/_next/static missing" && exit 1)
+
+ # Build metadata
+ - echo "๐ Writing build-info.json..."
- |
cat < out/build-info.json
{
@@ -50,19 +64,12 @@ default:
"built_at": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")",
"NEXT_PUBLIC_LTI_URL": "$NEXT_PUBLIC_LTI_URL",
"NEXT_PUBLIC_SSO_LOGIN_URL": "$NEXT_PUBLIC_SSO_LOGIN_URL",
- "NEXT_PUBLIC_API_BASE_URL": "$NEXT_PUBLIC_API_BASE_URL",
- "NEXT_PUBLIC_CLIENT_ID": "$NEXT_PUBLIC_CLIENT_ID"
+ "NEXT_PUBLIC_API_BASE_URL": "$NEXT_PUBLIC_API_BASE_URL"
}
EOF
- # โ
Verifikasi cepat (biar ketahuan out/ isinya bener)
- - echo "===== out/ preview ====="
- - ls -lah out | head -n 50
- - echo "===== _next assets preview ====="
- - ls -lah out/_next/static/chunks 2>/dev/null | head -n 30 || true
-
artifacts:
- name: 'out-$CI_COMMIT_SHORT_SHA'
+ name: "out-$CI_COMMIT_SHORT_SHA"
paths:
- out/
expire_in: 1 week
From 7ac92ff451e93670cbdbb549cb98acc8c419080e Mon Sep 17 00:00:00 2001
From: ValdiANS
Date: Mon, 2 Feb 2026 10:59:44 +0700
Subject: [PATCH 4/4] chore: implement permission guard for approve/reject
button
---
.../detail/DetailDailyChecklistContent.tsx | 41 ++++++++++---------
1 file changed, 22 insertions(+), 19 deletions(-)
diff --git a/src/figma-make/components/pages/list-daily-checklist/detail/DetailDailyChecklistContent.tsx b/src/figma-make/components/pages/list-daily-checklist/detail/DetailDailyChecklistContent.tsx
index d8723df0..bc9653d4 100644
--- a/src/figma-make/components/pages/list-daily-checklist/detail/DetailDailyChecklistContent.tsx
+++ b/src/figma-make/components/pages/list-daily-checklist/detail/DetailDailyChecklistContent.tsx
@@ -23,6 +23,7 @@ import { isResponseError } from '@/lib/api-helper';
import Link from 'next/link';
import { Icon } from '@iconify/react';
import { Document } from '@/types/api/api-general';
+import RequirePermission from '@/components/helper/RequirePermission';
interface ChecklistDetailRow {
checklist_id: string;
@@ -593,25 +594,27 @@ export function DetailDailyChecklistContent() {
{header.status === 'SUBMITTED' && (
-
-
-
-
+
+
+
+
+
+
)}