Compare commits
19 Commits
chore/FIBE
...
fix/254-in
| Author | SHA1 | Date | |
|---|---|---|---|
| c5826a34d0 | |||
| 7de6d899f1 | |||
| e582eb1693 | |||
| 41a90ad76e | |||
| b880137084 | |||
| fca3194801 | |||
| 22c1df67c1 | |||
| ef6b6a3ad4 | |||
| 8156c1f207 | |||
| 8a31ca0199 | |||
| d58b6bfd0b | |||
| e8b91468a1 | |||
| ac60822134 | |||
| 87e9fac4c1 | |||
| c061e821c9 | |||
| 63cce69634 | |||
| ff73898dac | |||
| 0715e66a65 | |||
| 205f0091dc |
9
.dockerignore
Normal file
9
.dockerignore
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
.next
|
||||||
|
node_modules
|
||||||
|
.git
|
||||||
|
.env.local
|
||||||
|
.env.*.local
|
||||||
|
npm-debug.log*
|
||||||
|
*.log
|
||||||
|
test-results
|
||||||
|
playwright-report
|
||||||
21
Dockerfile
Normal file
21
Dockerfile
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
FROM node:22-alpine AS builder
|
||||||
|
WORKDIR /app
|
||||||
|
ENV NODE_ENV=development
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN npm ci
|
||||||
|
COPY . .
|
||||||
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
FROM node:22-alpine AS runner
|
||||||
|
WORKDIR /app
|
||||||
|
ENV NODE_ENV=production
|
||||||
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
|
|
||||||
|
COPY --from=builder /app/package*.json ./
|
||||||
|
COPY --from=builder /app/.next ./.next
|
||||||
|
COPY --from=builder /app/node_modules ./node_modules
|
||||||
|
|
||||||
|
EXPOSE 3000
|
||||||
|
ENV PORT=3000
|
||||||
|
CMD ["node_modules/.bin/next", "start"]
|
||||||
@@ -1,4 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
export const dynamic = "force-dynamic";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
export const dynamic = "force-dynamic";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import { useQuery, useMutation } from "@tanstack/react-query";
|
import { useQuery, useMutation } from "@tanstack/react-query";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|||||||
@@ -154,7 +154,20 @@ export default function InvoicesPage() {
|
|||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
{/* Invoice Detail Modal */}
|
{/* Invoice Detail Modal */}
|
||||||
<Modal isOpen={!!selected} onClose={() => setSelected(null)} title={`Invoice ${selected?.invoiceNumber ?? ""}`} className="max-w-lg">
|
<Modal
|
||||||
|
isOpen={!!selected}
|
||||||
|
onClose={() => setSelected(null)}
|
||||||
|
title={`Invoice ${selected?.invoiceNumber ?? ""}`}
|
||||||
|
className="max-w-lg"
|
||||||
|
footer={selected ? (
|
||||||
|
<>
|
||||||
|
{selected.status !== "VOID" && selected.status !== "PAID" && (
|
||||||
|
<Button variant="danger" size="sm" onClick={() => voidInvoice.mutate(selected.id)} isLoading={voidInvoice.isPending}>Void Invoice</Button>
|
||||||
|
)}
|
||||||
|
<Button variant="outline" size="sm" onClick={() => setSelected(null)}>Close</Button>
|
||||||
|
</>
|
||||||
|
) : undefined}
|
||||||
|
>
|
||||||
{selected && (
|
{selected && (
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
<div className="bg-gray-50 rounded-lg p-4 space-y-2 text-sm">
|
<div className="bg-gray-50 rounded-lg p-4 space-y-2 text-sm">
|
||||||
@@ -196,13 +209,6 @@ export default function InvoicesPage() {
|
|||||||
disabled={!payForm.amount}>Record Payment</Button>
|
disabled={!payForm.amount}>Record Payment</Button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="flex justify-between pt-1">
|
|
||||||
{selected.status !== "VOID" && selected.status !== "PAID" && (
|
|
||||||
<Button variant="danger" size="sm" onClick={() => voidInvoice.mutate(selected.id)} isLoading={voidInvoice.isPending}>Void Invoice</Button>
|
|
||||||
)}
|
|
||||||
<Button variant="outline" size="sm" onClick={() => setSelected(null)} className="ml-auto">Close</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
export const dynamic = 'force-dynamic';
|
||||||
|
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { useRouter } from 'next/navigation';
|
import { useRouter } from 'next/navigation';
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
export const dynamic = "force-dynamic";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import Providers from '@/components/providers';
|
|||||||
// Fonts are loaded via CSS @import in globals.css (runtime CDN load).
|
// Fonts are loaded via CSS @import in globals.css (runtime CDN load).
|
||||||
// CSS vars are set directly in globals.css :root — no JS injection needed.
|
// CSS vars are set directly in globals.css :root — no JS injection needed.
|
||||||
|
|
||||||
|
export const dynamic = 'force-dynamic';
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: 'FiberOps Admin',
|
title: 'FiberOps Admin',
|
||||||
description: 'ISP Management Platform',
|
description: 'ISP Management Platform',
|
||||||
|
|||||||
12
pages/_document.tsx
Normal file
12
pages/_document.tsx
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import { Html, Head, Main, NextScript } from 'next/document';
|
||||||
|
export default function Document() {
|
||||||
|
return (
|
||||||
|
<Html lang="en">
|
||||||
|
<Head />
|
||||||
|
<body>
|
||||||
|
<Main />
|
||||||
|
<NextScript />
|
||||||
|
</body>
|
||||||
|
</Html>
|
||||||
|
);
|
||||||
|
}
|
||||||
14
pages/_error.tsx
Normal file
14
pages/_error.tsx
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
// Custom error page — prevents Html import issue in Next.js pages router
|
||||||
|
export default function Error({ statusCode }: { statusCode?: number }) {
|
||||||
|
return (
|
||||||
|
<div style={{ padding: '2rem', fontFamily: 'sans-serif' }}>
|
||||||
|
<h1>{statusCode || 'Error'}</h1>
|
||||||
|
<p>{statusCode === 404 ? 'Page not found' : 'An error occurred'}</p>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Error.getInitialProps = ({ res, err }: any) => {
|
||||||
|
const statusCode = res ? res.statusCode : err ? err.statusCode : 404;
|
||||||
|
return { statusCode };
|
||||||
|
};
|
||||||
0
public/.gitkeep
Normal file
0
public/.gitkeep
Normal file
@@ -9,10 +9,11 @@ interface ModalProps {
|
|||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
title: string;
|
title: string;
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
|
footer?: React.ReactNode;
|
||||||
className?: string;
|
className?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Modal({ isOpen, onClose, title, children, className }: ModalProps) {
|
export function Modal({ isOpen, onClose, title, children, footer, className }: ModalProps) {
|
||||||
const overlayRef = useRef<HTMLDivElement>(null);
|
const overlayRef = useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -31,8 +32,8 @@ export function Modal({ isOpen, onClose, title, children, className }: ModalProp
|
|||||||
className="fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4"
|
className="fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4"
|
||||||
onClick={(e) => e.target === overlayRef.current && onClose()}
|
onClick={(e) => e.target === overlayRef.current && onClose()}
|
||||||
>
|
>
|
||||||
<div className={cn("w-full max-w-lg rounded-xl bg-white shadow-xl", className)}>
|
<div className={cn("w-full max-w-lg rounded-xl bg-white shadow-xl flex flex-col max-h-[90vh]", className)}>
|
||||||
<div className="flex items-center justify-between border-b border-gray-100 px-6 py-4">
|
<div className="flex items-center justify-between border-b border-gray-100 px-6 py-4 flex-shrink-0">
|
||||||
<h3 className="text-base font-semibold text-gray-900">{title}</h3>
|
<h3 className="text-base font-semibold text-gray-900">{title}</h3>
|
||||||
<button
|
<button
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
@@ -41,7 +42,12 @@ export function Modal({ isOpen, onClose, title, children, className }: ModalProp
|
|||||||
<X className="h-5 w-5" />
|
<X className="h-5 w-5" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="px-6 py-4">{children}</div>
|
<div className="px-6 py-4 overflow-y-auto flex-1">{children}</div>
|
||||||
|
{footer && (
|
||||||
|
<div className="flex items-center justify-end gap-2 border-t border-gray-100 px-6 py-3 flex-shrink-0">
|
||||||
|
{footer}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user