mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-24 15:25:46 +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
|
.build_template: &build_template
|
||||||
stage: build
|
stage: build
|
||||||
image: node:20-alpine
|
image: node:20-alpine
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
key: npm-cache
|
key: npm-cache
|
||||||
paths:
|
paths:
|
||||||
- node_modules/
|
- node_modules/
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
NPM_CONFIG_PRODUCTION: 'false'
|
NODE_ENV: ""
|
||||||
NODE_ENV: ''
|
NPM_CONFIG_PRODUCTION: "false"
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- echo "Installing dependencies..."
|
# Install dependencies
|
||||||
|
- echo "📦 Installing dependencies..."
|
||||||
- npm ci --no-audit --no-fund
|
- 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_LTI_URL=$NEXT_PUBLIC_LTI_URL"
|
||||||
- echo "NEXT_PUBLIC_SSO_LOGIN_URL=$NEXT_PUBLIC_SSO_LOGIN_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_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
|
- 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
|
cat <<EOF > out/build-info.json
|
||||||
{
|
{
|
||||||
"commit": "$CI_COMMIT_SHORT_SHA",
|
"commit": "$CI_COMMIT_SHORT_SHA",
|
||||||
@@ -44,8 +67,9 @@ default:
|
|||||||
"NEXT_PUBLIC_API_BASE_URL": "$NEXT_PUBLIC_API_BASE_URL"
|
"NEXT_PUBLIC_API_BASE_URL": "$NEXT_PUBLIC_API_BASE_URL"
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
+25
-20
@@ -36,6 +36,7 @@ import { ColumnDef } from '@tanstack/react-table';
|
|||||||
import { useSelect } from '@/components/input/SelectInput';
|
import { useSelect } from '@/components/input/SelectInput';
|
||||||
import { KandangApi } from '@/services/api/master-data';
|
import { KandangApi } from '@/services/api/master-data';
|
||||||
import DebouncedTextInput from '@/components/input/DebouncedTextInput';
|
import DebouncedTextInput from '@/components/input/DebouncedTextInput';
|
||||||
|
import RequirePermission from '@/components/helper/RequirePermission';
|
||||||
|
|
||||||
interface Kandang {
|
interface Kandang {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -389,19 +390,21 @@ export function ListDailyChecklistContent() {
|
|||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
{row.original.status === 'DRAFT' && (
|
{row.original.status === 'DRAFT' && (
|
||||||
<Button
|
<RequirePermission permissions='lti.daily_checklist.create'>
|
||||||
size='sm'
|
<Button
|
||||||
variant='outline'
|
size='sm'
|
||||||
onClick={() => handleEdit(row.original)}
|
variant='outline'
|
||||||
className='border-gray-200 text-gray-700 hover:bg-gray-50'
|
onClick={() => handleEdit(row.original)}
|
||||||
>
|
className='border-gray-200 text-gray-700 hover:bg-gray-50'
|
||||||
<Edit className='w-4 h-4 mr-1' />
|
>
|
||||||
Edit
|
<Edit className='w-4 h-4 mr-1' />
|
||||||
</Button>
|
Edit
|
||||||
|
</Button>
|
||||||
|
</RequirePermission>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{row.original.status === 'SUBMITTED' && (
|
{row.original.status === 'SUBMITTED' && (
|
||||||
<>
|
<RequirePermission permissions='lti.daily_checklist.create'>
|
||||||
<Button
|
<Button
|
||||||
size='sm'
|
size='sm'
|
||||||
onClick={() => handleApprove(row.original)}
|
onClick={() => handleApprove(row.original)}
|
||||||
@@ -419,19 +422,21 @@ export function ListDailyChecklistContent() {
|
|||||||
<XCircle className='w-4 h-4 mr-1' />
|
<XCircle className='w-4 h-4 mr-1' />
|
||||||
Reject
|
Reject
|
||||||
</Button>
|
</Button>
|
||||||
</>
|
</RequirePermission>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{row.original.status === 'DRAFT' && (
|
{row.original.status === 'DRAFT' && (
|
||||||
<Button
|
<RequirePermission permissions='lti.daily_checklist.create'>
|
||||||
size='sm'
|
<Button
|
||||||
variant='destructive'
|
size='sm'
|
||||||
onClick={() => handleDelete(row.original)}
|
variant='destructive'
|
||||||
className='bg-red-600 hover:bg-red-700 text-white'
|
onClick={() => handleDelete(row.original)}
|
||||||
>
|
className='bg-red-600 hover:bg-red-700 text-white'
|
||||||
<Trash2 className='w-4 h-4 mr-1' />
|
>
|
||||||
Hapus
|
<Trash2 className='w-4 h-4 mr-1' />
|
||||||
</Button>
|
Hapus
|
||||||
|
</Button>
|
||||||
|
</RequirePermission>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
|
|||||||
+22
-19
@@ -23,6 +23,7 @@ import { isResponseError } from '@/lib/api-helper';
|
|||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { Icon } from '@iconify/react';
|
import { Icon } from '@iconify/react';
|
||||||
import { Document } from '@/types/api/api-general';
|
import { Document } from '@/types/api/api-general';
|
||||||
|
import RequirePermission from '@/components/helper/RequirePermission';
|
||||||
|
|
||||||
interface ChecklistDetailRow {
|
interface ChecklistDetailRow {
|
||||||
checklist_id: string;
|
checklist_id: string;
|
||||||
@@ -593,25 +594,27 @@ export function DetailDailyChecklistContent() {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
{header.status === 'SUBMITTED' && (
|
{header.status === 'SUBMITTED' && (
|
||||||
<div className='flex gap-2'>
|
<RequirePermission permissions='lti.daily_checklist.create'>
|
||||||
<Button
|
<div className='flex gap-2'>
|
||||||
onClick={handleApprove}
|
<Button
|
||||||
disabled={actionLoading}
|
onClick={handleApprove}
|
||||||
className='bg-green-600 hover:bg-green-700 text-white'
|
disabled={actionLoading}
|
||||||
>
|
className='bg-green-600 hover:bg-green-700 text-white'
|
||||||
<CheckCircle className='w-4 h-4 mr-2' />
|
>
|
||||||
Approve
|
<CheckCircle className='w-4 h-4 mr-2' />
|
||||||
</Button>
|
Approve
|
||||||
<Button
|
</Button>
|
||||||
onClick={handleReject}
|
<Button
|
||||||
disabled={actionLoading}
|
onClick={handleReject}
|
||||||
variant='destructive'
|
disabled={actionLoading}
|
||||||
className='bg-red-600 hover:bg-red-700 text-white'
|
variant='destructive'
|
||||||
>
|
className='bg-red-600 hover:bg-red-700 text-white'
|
||||||
<XCircle className='w-4 h-4 mr-2' />
|
>
|
||||||
Reject
|
<XCircle className='w-4 h-4 mr-2' />
|
||||||
</Button>
|
Reject
|
||||||
</div>
|
</Button>
|
||||||
|
</div>
|
||||||
|
</RequirePermission>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user