mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into dev/restu
This commit is contained in:
+31
-7
@@ -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 <<EOF > 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
|
||||
|
||||
+25
-20
@@ -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() {
|
||||
</Button>
|
||||
|
||||
{row.original.status === 'DRAFT' && (
|
||||
<Button
|
||||
size='sm'
|
||||
variant='outline'
|
||||
onClick={() => handleEdit(row.original)}
|
||||
className='border-gray-200 text-gray-700 hover:bg-gray-50'
|
||||
>
|
||||
<Edit className='w-4 h-4 mr-1' />
|
||||
Edit
|
||||
</Button>
|
||||
<RequirePermission permissions='lti.daily_checklist.create'>
|
||||
<Button
|
||||
size='sm'
|
||||
variant='outline'
|
||||
onClick={() => handleEdit(row.original)}
|
||||
className='border-gray-200 text-gray-700 hover:bg-gray-50'
|
||||
>
|
||||
<Edit className='w-4 h-4 mr-1' />
|
||||
Edit
|
||||
</Button>
|
||||
</RequirePermission>
|
||||
)}
|
||||
|
||||
{row.original.status === 'SUBMITTED' && (
|
||||
<>
|
||||
<RequirePermission permissions='lti.daily_checklist.create'>
|
||||
<Button
|
||||
size='sm'
|
||||
onClick={() => handleApprove(row.original)}
|
||||
@@ -419,19 +422,21 @@ export function ListDailyChecklistContent() {
|
||||
<XCircle className='w-4 h-4 mr-1' />
|
||||
Reject
|
||||
</Button>
|
||||
</>
|
||||
</RequirePermission>
|
||||
)}
|
||||
|
||||
{row.original.status === 'DRAFT' && (
|
||||
<Button
|
||||
size='sm'
|
||||
variant='destructive'
|
||||
onClick={() => handleDelete(row.original)}
|
||||
className='bg-red-600 hover:bg-red-700 text-white'
|
||||
>
|
||||
<Trash2 className='w-4 h-4 mr-1' />
|
||||
Hapus
|
||||
</Button>
|
||||
<RequirePermission permissions='lti.daily_checklist.create'>
|
||||
<Button
|
||||
size='sm'
|
||||
variant='destructive'
|
||||
onClick={() => handleDelete(row.original)}
|
||||
className='bg-red-600 hover:bg-red-700 text-white'
|
||||
>
|
||||
<Trash2 className='w-4 h-4 mr-1' />
|
||||
Hapus
|
||||
</Button>
|
||||
</RequirePermission>
|
||||
)}
|
||||
</div>
|
||||
),
|
||||
|
||||
+22
-19
@@ -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() {
|
||||
</p>
|
||||
</div>
|
||||
{header.status === 'SUBMITTED' && (
|
||||
<div className='flex gap-2'>
|
||||
<Button
|
||||
onClick={handleApprove}
|
||||
disabled={actionLoading}
|
||||
className='bg-green-600 hover:bg-green-700 text-white'
|
||||
>
|
||||
<CheckCircle className='w-4 h-4 mr-2' />
|
||||
Approve
|
||||
</Button>
|
||||
<Button
|
||||
onClick={handleReject}
|
||||
disabled={actionLoading}
|
||||
variant='destructive'
|
||||
className='bg-red-600 hover:bg-red-700 text-white'
|
||||
>
|
||||
<XCircle className='w-4 h-4 mr-2' />
|
||||
Reject
|
||||
</Button>
|
||||
</div>
|
||||
<RequirePermission permissions='lti.daily_checklist.create'>
|
||||
<div className='flex gap-2'>
|
||||
<Button
|
||||
onClick={handleApprove}
|
||||
disabled={actionLoading}
|
||||
className='bg-green-600 hover:bg-green-700 text-white'
|
||||
>
|
||||
<CheckCircle className='w-4 h-4 mr-2' />
|
||||
Approve
|
||||
</Button>
|
||||
<Button
|
||||
onClick={handleReject}
|
||||
disabled={actionLoading}
|
||||
variant='destructive'
|
||||
className='bg-red-600 hover:bg-red-700 text-white'
|
||||
>
|
||||
<XCircle className='w-4 h-4 mr-2' />
|
||||
Reject
|
||||
</Button>
|
||||
</div>
|
||||
</RequirePermission>
|
||||
)}
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user