This commit is contained in:
natib21
2026-07-10 11:25:59 +00:00
parent 2696ca7498
commit e6e44e773b
1146 changed files with 200266 additions and 90527 deletions

View File

@@ -0,0 +1,12 @@
// STUB — see DMS/pages/_shared/utils.ts. DMS documents API, not migrated.
// Returns empty lists so document lists render empty instead of crashing.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export async function listMyDocuments(..._args: any[]): Promise<any[]> {
return [];
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export async function getMyShares(..._args: any[]): Promise<any[]> {
return [];
}

View File

@@ -0,0 +1,24 @@
// STUB — see DMS/pages/_shared/utils.ts. DMS HTTP client, not migrated.
// Returns empty payloads so any DMS call degrades to "no results" rather than
// crashing. Wire the real @/DMS/api/dms.http if DMS is brought over.
function warn(method: string, url: string) {
// eslint-disable-next-line no-console
console.warn(`[DMS stub] ${method} ${url} — DMS is not migrated; returning empty.`);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
async function empty<T = any>(): Promise<{ data: T }> {
return { data: {} as T };
}
export const dmsHttp = {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
get: <T = any>(url: string): Promise<{ data: T }> => (warn("GET", url), empty<T>()),
// eslint-disable-next-line @typescript-eslint/no-explicit-any
post: <T = any>(url: string): Promise<{ data: T }> => (warn("POST", url), empty<T>()),
// eslint-disable-next-line @typescript-eslint/no-explicit-any
put: <T = any>(url: string): Promise<{ data: T }> => (warn("PUT", url), empty<T>()),
// eslint-disable-next-line @typescript-eslint/no-explicit-any
delete: <T = any>(url: string): Promise<{ data: T }> => (warn("DELETE", url), empty<T>()),
};

View File

@@ -0,0 +1,12 @@
// STUB — see DMS/pages/_shared/utils.ts. DMS folders API, not migrated.
// Returns empty lists so folder pickers render empty instead of crashing.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export async function getMySubFolders(..._args: any[]): Promise<any[]> {
return [];
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export async function getMyCollaborationsSubFolders(..._args: any[]): Promise<any[]> {
return [];
}

View File

@@ -0,0 +1,21 @@
// STUB — see DMS/pages/_shared/utils.ts. DMS is not migrated; inert placeholder.
export type FileKind =
| "word"
| "excel"
| "ppt"
| "pdf"
| "image"
| "video"
| "file";
export function detectFileKind(nameOrMime?: string | null): FileKind {
const s = (nameOrMime ?? "").toLowerCase();
if (/\.(docx?|word)/.test(s)) return "word";
if (/\.(xlsx?|csv)/.test(s)) return "excel";
if (/\.(pptx?)/.test(s)) return "ppt";
if (/\.pdf/.test(s)) return "pdf";
if (/\.(png|jpe?g|gif|webp|svg|image)/.test(s)) return "image";
if (/\.(mp4|mov|avi|video)/.test(s)) return "video";
return "file";
}

View File

@@ -0,0 +1,14 @@
// STUB — see DMS/pages/_shared/utils.ts. DMS file-type icons, not migrated.
// Each renders nothing so document components resolve without the real assets.
import type { SVGProps } from "react";
const Empty = (_props: SVGProps<SVGSVGElement>) => null;
export const ODWinFolderSvg = Empty;
export const ODIconWord = Empty;
export const ODIconExcel = Empty;
export const ODIconPpt = Empty;
export const ODIconPdf = Empty;
export const ODIconImage = Empty;
export const ODIconVideo = Empty;
export const ODIconFile = Empty;

View File

@@ -0,0 +1,20 @@
// STUB — @/DMS is not migrated into this backoffice. These placeholders exist
// only so record-management's document components resolve; the DMS feature is
// inert here. Replace with the real @/DMS module if DMS is ever brought over.
export function formatBytes(bytes?: number | null): string {
if (!bytes || bytes <= 0) return "0 B";
const units = ["B", "KB", "MB", "GB", "TB"];
const i = Math.floor(Math.log(bytes) / Math.log(1024));
return `${(bytes / Math.pow(1024, i)).toFixed(1)} ${units[i] ?? "B"}`;
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function resolveOwnerName(owner?: any): string {
return owner?.name ?? owner?.username ?? owner?.email ?? "";
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function pickName(item?: any): string {
return item?.name ?? item?.title ?? item?.fileName ?? "";
}