diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e80a7e02..9bdfffa4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,24 +16,47 @@ 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 "Building Next.js static export..." + + # Clean old output + - echo "๐Ÿงน Cleaning old build..." + - rm -rf .next out + + # Build Next.js + - echo "๐Ÿ—๏ธ Running Next.js build..." - npx next build + + # Export static site + - echo "๐Ÿ“ค Exporting static site..." + - npx next export + + # 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..." - | - mkdir -p out cat < out/build-info.json { "commit": "$CI_COMMIT_SHORT_SHA", @@ -44,8 +67,9 @@ default: "NEXT_PUBLIC_API_BASE_URL": "$NEXT_PUBLIC_API_BASE_URL" } EOF + artifacts: - name: 'out-$CI_COMMIT_SHORT_SHA' + name: "out-$CI_COMMIT_SHORT_SHA" paths: - out/ expire_in: 1 week 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' && ( - + + + )} ), 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' && ( -
- - -
+ +
+ + +
+
)}