Add Legal Office seal and complete Azure CDN deployment
- Add Legal Office of the Master seal (SVG design with Maltese Cross, scales of justice, legal scroll) - Create legal-office-manifest-template.json for Legal Office credentials - Update SEAL_MAPPING.md and DESIGN_GUIDE.md with Legal Office seal documentation - Complete Azure CDN infrastructure deployment: - Resource group, storage account, and container created - 17 PNG seal files uploaded to Azure Blob Storage - All manifest templates updated with Azure URLs - Configuration files generated (azure-cdn-config.env) - Add comprehensive Azure CDN setup scripts and documentation - Fix manifest URL generation to prevent double slashes - Verify all seals accessible via HTTPS
This commit is contained in:
@@ -5,7 +5,7 @@ import { useQuery } from '@tanstack/react-query';
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle, Input, Label, Select, Button, Badge, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Skeleton } from '@the-order/ui';
|
||||
import { getApiClient } from '@the-order/api-client';
|
||||
|
||||
export default function AuditPage() {
|
||||
export default function AuditPage(): JSX.Element {
|
||||
const apiClient = getApiClient();
|
||||
const [filters, setFilters] = useState({
|
||||
action: '',
|
||||
@@ -15,19 +15,20 @@ export default function AuditPage() {
|
||||
pageSize: 50,
|
||||
});
|
||||
|
||||
const { data: auditLogs, isLoading, error } = useQuery({
|
||||
const { data: auditLogs, isLoading, error } = useQuery<Awaited<ReturnType<typeof apiClient.identity.searchAuditLogs>>>({
|
||||
queryKey: ['audit-logs', filters],
|
||||
queryFn: () =>
|
||||
apiClient.identity.searchAuditLogs({
|
||||
queryFn: async () => {
|
||||
return await apiClient.identity.searchAuditLogs({
|
||||
action: filters.action as 'issued' | 'revoked' | 'verified' | 'renewed' | undefined,
|
||||
credentialId: filters.credentialId || undefined,
|
||||
subjectDid: filters.subjectDid || undefined,
|
||||
page: filters.page,
|
||||
pageSize: filters.pageSize,
|
||||
}),
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
const getActionBadge = (action: string) => {
|
||||
const getActionBadge = (action: string): JSX.Element => {
|
||||
switch (action) {
|
||||
case 'issued':
|
||||
return <Badge variant="success">Issued</Badge>;
|
||||
@@ -142,20 +143,20 @@ export default function AuditPage() {
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{auditLogs.logs.map((log: any) => (
|
||||
<TableRow key={log.id || `${log.credential_id}-${log.performed_at}`}>
|
||||
{auditLogs.logs.map((log: { id: string; action: string; credentialId?: string; subjectDid?: string; performedBy?: string; timestamp: string; metadata?: Record<string, unknown> }) => (
|
||||
<TableRow key={log.id || `${log.credentialId || 'unknown'}-${log.timestamp}`}>
|
||||
<TableCell>
|
||||
{log.performed_at
|
||||
? new Date(log.performed_at).toLocaleString()
|
||||
{log.timestamp
|
||||
? new Date(log.timestamp).toLocaleString()
|
||||
: 'N/A'}
|
||||
</TableCell>
|
||||
<TableCell>{getActionBadge(log.action || 'unknown')}</TableCell>
|
||||
<TableCell className="font-mono text-sm">
|
||||
{log.credential_id || 'N/A'}
|
||||
{log.credentialId || 'N/A'}
|
||||
</TableCell>
|
||||
<TableCell className="font-mono text-sm">{log.subject_did || 'N/A'}</TableCell>
|
||||
<TableCell>{log.performed_by || 'System'}</TableCell>
|
||||
<TableCell className="font-mono text-sm">{log.ip_address || 'N/A'}</TableCell>
|
||||
<TableCell className="font-mono text-sm">{log.subjectDid || 'N/A'}</TableCell>
|
||||
<TableCell>{log.performedBy || 'System'}</TableCell>
|
||||
<TableCell className="font-mono text-sm">{log.metadata?.ipAddress as string || 'N/A'}</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</TableBody>
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
} from '@the-order/ui';
|
||||
import { getApiClient } from '@the-order/api-client';
|
||||
|
||||
export default function IssueCredentialPage() {
|
||||
export default function IssueCredentialPage(): JSX.Element {
|
||||
const router = useRouter();
|
||||
const apiClient = getApiClient();
|
||||
const { success, error: showError } = useToast();
|
||||
@@ -36,7 +36,7 @@ export default function IssueCredentialPage() {
|
||||
notes: '',
|
||||
});
|
||||
|
||||
const mutation = useMutation({
|
||||
const mutation = useMutation<Awaited<ReturnType<typeof apiClient.identity.issueCredential>>, Error, typeof formData>({
|
||||
mutationFn: async (data: typeof formData) => {
|
||||
const credentialSubject: Record<string, unknown> = {
|
||||
givenName: data.givenName,
|
||||
@@ -51,7 +51,7 @@ export default function IssueCredentialPage() {
|
||||
credentialSubject.nationality = data.nationality;
|
||||
}
|
||||
|
||||
return apiClient.identity.issueCredential({
|
||||
return await apiClient.identity.issueCredential({
|
||||
subject: data.subjectDid,
|
||||
credentialSubject,
|
||||
expirationDate: data.expirationDate || undefined,
|
||||
@@ -69,7 +69,7 @@ export default function IssueCredentialPage() {
|
||||
},
|
||||
});
|
||||
|
||||
const handleSubmit = (e: React.FormEvent) => {
|
||||
const handleSubmit = (e: React.FormEvent<HTMLFormElement>): void => {
|
||||
e.preventDefault();
|
||||
if (!formData.subjectDid.trim()) {
|
||||
showError('Subject DID is required', 'Validation Error');
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useQuery } from '@tanstack/react-query';
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle, Input, Label, Button, Badge, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Skeleton } from '@the-order/ui';
|
||||
import { getApiClient } from '@the-order/api-client';
|
||||
|
||||
export default function CredentialsPage() {
|
||||
export default function CredentialsPage(): JSX.Element {
|
||||
const router = useRouter();
|
||||
const apiClient = getApiClient();
|
||||
const [searchTerm, setSearchTerm] = useState('');
|
||||
@@ -22,9 +22,9 @@ export default function CredentialsPage() {
|
||||
},
|
||||
});
|
||||
|
||||
const filteredData = metrics?.filter((item) =>
|
||||
const filteredData = metrics?.filter((item: { credentialId: string; credentialType: string[] }) =>
|
||||
item.credentialId.toLowerCase().includes(searchTerm.toLowerCase()) ||
|
||||
item.credentialType.some((type) => type.toLowerCase().includes(searchTerm.toLowerCase()))
|
||||
item.credentialType.some((type: string) => type.toLowerCase().includes(searchTerm.toLowerCase()))
|
||||
);
|
||||
|
||||
return (
|
||||
@@ -74,12 +74,12 @@ export default function CredentialsPage() {
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{filteredData.map((credential) => (
|
||||
{filteredData.map((credential: { credentialId: string; credentialType: string[]; issuedAt: Date; subjectDid: string }) => (
|
||||
<TableRow key={credential.credentialId}>
|
||||
<TableCell className="font-mono text-sm">{credential.credentialId}</TableCell>
|
||||
<TableCell>
|
||||
<div className="flex flex-wrap gap-1">
|
||||
{credential.credentialType.map((type) => (
|
||||
{credential.credentialType.map((type: string) => (
|
||||
<Badge key={type} variant="secondary">
|
||||
{type}
|
||||
</Badge>
|
||||
|
||||
@@ -13,7 +13,7 @@ export default function RootLayout({
|
||||
children,
|
||||
}: {
|
||||
children: ReactNode;
|
||||
}) {
|
||||
}): JSX.Element {
|
||||
return (
|
||||
<html lang="en">
|
||||
<body className="flex flex-col min-h-screen">
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle, Input, Label
|
||||
import { useAuth } from '../../lib/auth';
|
||||
import { useToast } from '@the-order/ui';
|
||||
|
||||
export default function LoginPage() {
|
||||
export default function LoginPage(): JSX.Element {
|
||||
const router = useRouter();
|
||||
const { login } = useAuth();
|
||||
const { success, error: showError } = useToast();
|
||||
@@ -17,7 +17,7 @@ export default function LoginPage() {
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [loginError, setLoginError] = useState<string | null>(null);
|
||||
|
||||
const handleSubmit = async (e: React.FormEvent) => {
|
||||
const handleSubmit = async (e: React.FormEvent<HTMLFormElement>): Promise<void> => {
|
||||
e.preventDefault();
|
||||
setIsLoading(true);
|
||||
setLoginError(null);
|
||||
@@ -62,7 +62,7 @@ export default function LoginPage() {
|
||||
<CardDescription>Sign in to the internal portal</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<form onSubmit={handleSubmit} className="space-y-4">
|
||||
<form onSubmit={(e) => { void handleSubmit(e); }} className="space-y-4">
|
||||
{loginError && (
|
||||
<Alert variant="destructive">
|
||||
<AlertDescription>{loginError}</AlertDescription>
|
||||
|
||||
@@ -4,12 +4,14 @@ import { useQuery } from '@tanstack/react-query';
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle, Badge, Skeleton, Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@the-order/ui';
|
||||
import { getApiClient } from '@the-order/api-client';
|
||||
|
||||
export default function MetricsPage() {
|
||||
export default function MetricsPage(): JSX.Element {
|
||||
const apiClient = getApiClient();
|
||||
|
||||
const { data: dashboard, isLoading, error } = useQuery({
|
||||
const { data: dashboard, isLoading, error } = useQuery<Awaited<ReturnType<typeof apiClient.identity.getMetricsDashboard>>>({
|
||||
queryKey: ['metrics-dashboard'],
|
||||
queryFn: () => apiClient.identity.getMetricsDashboard(),
|
||||
queryFn: async () => {
|
||||
return await apiClient.identity.getMetricsDashboard();
|
||||
},
|
||||
});
|
||||
|
||||
if (isLoading) {
|
||||
@@ -96,7 +98,7 @@ export default function MetricsPage() {
|
||||
<CardTitle className="text-sm font-medium text-gray-500">Success Rate</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="text-3xl font-bold">{summary?.successRate.toFixed(1) || 0}%</div>
|
||||
<div className="text-3xl font-bold">{summary?.successRate ? summary.successRate.toFixed(1) : 0}%</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
@@ -118,7 +120,7 @@ export default function MetricsPage() {
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{dashboard.topCredentialTypes.map((item) => (
|
||||
{dashboard.topCredentialTypes.map((item: { type: string; count: number; percentage: number }) => (
|
||||
<TableRow key={item.type}>
|
||||
<TableCell>{item.type}</TableCell>
|
||||
<TableCell>{item.count}</TableCell>
|
||||
@@ -141,7 +143,7 @@ export default function MetricsPage() {
|
||||
<CardContent>
|
||||
{summary?.recentIssuances && summary.recentIssuances.length > 0 ? (
|
||||
<div className="space-y-4">
|
||||
{summary.recentIssuances.map((issuance) => (
|
||||
{summary.recentIssuances.map((issuance: { credentialId: string; credentialType: string[]; issuedAt: Date; subjectDid: string }) => (
|
||||
<div key={issuance.credentialId} className="flex items-center justify-between border-b pb-3">
|
||||
<div>
|
||||
<p className="font-medium">{issuance.credentialType.join(', ')}</p>
|
||||
@@ -170,7 +172,7 @@ export default function MetricsPage() {
|
||||
<CardContent>
|
||||
{summary?.byCredentialType && Object.keys(summary.byCredentialType).length > 0 ? (
|
||||
<div className="space-y-2">
|
||||
{Object.entries(summary.byCredentialType).map(([type, count]) => (
|
||||
{Object.entries(summary.byCredentialType).map(([type, count]: [string, number]) => (
|
||||
<div key={type} className="flex items-center justify-between">
|
||||
<span className="text-sm font-medium">{type}</span>
|
||||
<Badge>{count}</Badge>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Link from 'next/link';
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@the-order/ui';
|
||||
|
||||
export default function Home() {
|
||||
export default function Home(): JSX.Element {
|
||||
return (
|
||||
<div className="min-h-screen bg-gray-50">
|
||||
<div className="container mx-auto px-4 py-16">
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle, Button, Badg
|
||||
import { getApiClient } from '@the-order/api-client';
|
||||
import { useState } from 'react';
|
||||
|
||||
export default function ReviewDetailPage() {
|
||||
export default function ReviewDetailPage(): JSX.Element {
|
||||
const params = useParams();
|
||||
const router = useRouter();
|
||||
const queryClient = useQueryClient();
|
||||
@@ -17,14 +17,16 @@ export default function ReviewDetailPage() {
|
||||
const [reason, setReason] = useState('');
|
||||
const { success, error: showError } = useToast();
|
||||
|
||||
const { data: application, isLoading, error } = useQuery({
|
||||
const { data: application, isLoading, error } = useQuery<Awaited<ReturnType<typeof apiClient.eresidency.getApplicationForReview>>>({
|
||||
queryKey: ['application', applicationId],
|
||||
queryFn: () => apiClient.eresidency.getApplicationForReview(applicationId),
|
||||
queryFn: async () => {
|
||||
return await apiClient.eresidency.getApplicationForReview(applicationId);
|
||||
},
|
||||
});
|
||||
|
||||
const adjudicateMutation = useMutation({
|
||||
const adjudicateMutation = useMutation<Awaited<ReturnType<typeof apiClient.eresidency.adjudicateApplication>>, Error, { decision: 'approve' | 'reject'; reason?: string; notes?: string }>({
|
||||
mutationFn: async (data: { decision: 'approve' | 'reject'; reason?: string; notes?: string }) => {
|
||||
return apiClient.eresidency.adjudicateApplication(applicationId, data);
|
||||
return await apiClient.eresidency.adjudicateApplication(applicationId, data);
|
||||
},
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ['application', applicationId] });
|
||||
@@ -75,7 +77,7 @@ export default function ReviewDetailPage() {
|
||||
);
|
||||
}
|
||||
|
||||
const getStatusBadge = (status: string) => {
|
||||
const getStatusBadge = (status: string): JSX.Element => {
|
||||
switch (status) {
|
||||
case 'approved':
|
||||
return <Badge variant="success">Approved</Badge>;
|
||||
@@ -90,7 +92,7 @@ export default function ReviewDetailPage() {
|
||||
}
|
||||
};
|
||||
|
||||
const handleAdjudicate = () => {
|
||||
const handleAdjudicate = (): void => {
|
||||
if (!decision) return;
|
||||
if (decision === 'reject' && !reason.trim()) {
|
||||
alert('Please provide a rejection reason');
|
||||
|
||||
@@ -5,12 +5,14 @@ import Link from 'next/link';
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@the-order/ui';
|
||||
import { getApiClient } from '@the-order/api-client';
|
||||
|
||||
export default function ReviewPage() {
|
||||
export default function ReviewPage(): JSX.Element {
|
||||
const apiClient = getApiClient();
|
||||
|
||||
const { data: queue, isLoading, error } = useQuery({
|
||||
const { data: queue, isLoading, error } = useQuery<Awaited<ReturnType<typeof apiClient.eresidency.getReviewQueue>>>({
|
||||
queryKey: ['review-queue'],
|
||||
queryFn: () => apiClient.eresidency.getReviewQueue({ limit: 50 }),
|
||||
queryFn: async () => {
|
||||
return await apiClient.eresidency.getReviewQueue({ limit: 50 });
|
||||
},
|
||||
});
|
||||
|
||||
if (isLoading) {
|
||||
@@ -45,7 +47,7 @@ export default function ReviewPage() {
|
||||
);
|
||||
}
|
||||
|
||||
const getStatusColor = (status: string) => {
|
||||
const getStatusColor = (status: string): string => {
|
||||
switch (status) {
|
||||
case 'under_review':
|
||||
return 'text-blue-600 bg-blue-50';
|
||||
@@ -80,7 +82,7 @@ export default function ReviewPage() {
|
||||
<p className="text-gray-600 text-center py-8">No applications in queue</p>
|
||||
) : (
|
||||
<div className="space-y-4">
|
||||
{queue.applications.map((app) => (
|
||||
{queue.applications.map((app: { id: string; givenName: string; familyName: string; email: string; submittedAt?: string; status: string; riskScore?: number }) => (
|
||||
<Link key={app.id} href={`/review/${app.id}`}>
|
||||
<Card className="hover:shadow-md transition-shadow cursor-pointer">
|
||||
<CardContent className="p-6">
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { useState } from 'react';
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle, Input, Label, Button, Switch, useToast } from '@the-order/ui';
|
||||
|
||||
export default function SettingsPage() {
|
||||
export default function SettingsPage(): JSX.Element {
|
||||
const { success } = useToast();
|
||||
const [settings, setSettings] = useState({
|
||||
siteName: 'The Order',
|
||||
@@ -14,7 +14,7 @@ export default function SettingsPage() {
|
||||
apiRateLimit: 100,
|
||||
});
|
||||
|
||||
const handleSave = () => {
|
||||
const handleSave = (): void => {
|
||||
// In production, this would save to an API
|
||||
success('Settings saved successfully', 'Your changes have been applied.');
|
||||
};
|
||||
|
||||
@@ -5,8 +5,7 @@ import { useQuery } from '@tanstack/react-query';
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle, Input, Button, Badge, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Skeleton, Dropdown } from '@the-order/ui';
|
||||
import { getApiClient } from '@the-order/api-client';
|
||||
|
||||
export default function UsersPage() {
|
||||
const apiClient = getApiClient();
|
||||
export default function UsersPage(): JSX.Element {
|
||||
const [searchTerm, setSearchTerm] = useState('');
|
||||
|
||||
// Mock data - in production, this would fetch from an API
|
||||
@@ -23,7 +22,7 @@ export default function UsersPage() {
|
||||
});
|
||||
|
||||
const filteredUsers = users?.filter(
|
||||
(user) =>
|
||||
(user: { email: string; name: string }) =>
|
||||
user.email.toLowerCase().includes(searchTerm.toLowerCase()) ||
|
||||
user.name.toLowerCase().includes(searchTerm.toLowerCase())
|
||||
);
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useEffect } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { useAuth } from '../lib/auth';
|
||||
|
||||
export function AuthGuard({ children }: { children: React.ReactNode }) {
|
||||
export function AuthGuard({ children }: { children: React.ReactNode }): JSX.Element | null {
|
||||
const { isAuthenticated, isLoading } = useAuth();
|
||||
const router = useRouter();
|
||||
|
||||
|
||||
@@ -5,11 +5,11 @@ import { useRouter } from 'next/navigation';
|
||||
import { Button } from '@the-order/ui';
|
||||
import { useAuth } from '../lib/auth';
|
||||
|
||||
export function Header() {
|
||||
export function Header(): JSX.Element {
|
||||
const router = useRouter();
|
||||
const { isAuthenticated, user, logout } = useAuth();
|
||||
|
||||
const handleLogout = () => {
|
||||
const handleLogout = (): void => {
|
||||
logout();
|
||||
router.push('/login');
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { ReactNode, useState } from 'react';
|
||||
import { ToastProvider } from '@the-order/ui';
|
||||
|
||||
export function Providers({ children }: { children: ReactNode }) {
|
||||
export function Providers({ children }: { children: ReactNode }): JSX.Element {
|
||||
const [queryClient] = useState(
|
||||
() =>
|
||||
new QueryClient({
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import type { NextRequest } from 'next/server';
|
||||
|
||||
export function middleware(request: NextRequest) {
|
||||
export function middleware(request: NextRequest): NextResponse {
|
||||
// Check if the request is for a protected route
|
||||
const protectedRoutes = ['/review', '/credentials', '/metrics', '/audit'];
|
||||
const isProtectedRoute = protectedRoutes.some((route) => request.nextUrl.pathname.startsWith(route));
|
||||
|
||||
Reference in New Issue
Block a user