# MR: Fetch-request source types, glass-pane create page, date formatting **Branch:** `xlsx-statement-support` → `main` **Commits:**1af0a6b→231869d(6 commits) ## Summary Three related strands of UI work on the fetch-request flow, plus library-level improvements in `react-openapi`: 1. **Source types** — the create form now offers Pdf / Xlsx / Csv / Email sources (spec-driven); legacy generic `file` is no longer offered for new fetch requests, and a per-request `trust_fallback` (`amount` | `balance`) can be set at creation. 2. **Create page redesign** — the flat single-column form is now two equal-height frosted "glass" panes over a subtle brand-indigo gradient backdrop: *Source & Account* (account/bank above the expanding source field) and *Window & Policy* (start/end/pipeline/trusted). Recent fetch-request rows share the same glass recipe. 3. **Date formatting** — all dates/datetimes across lists, details and display-format templates render as `"24 Aug 2026"` / `"24 Aug 2026, 09:07"` instead of raw ISO strings; datetime fields can opt into editing as a plain date picker while storing midnight. ## Changes ### react-openapi (library) - **`src/utils/datetime.ts` (new)** — zero-dep `formatDate` / `formatDateTime` (en-IN via `Intl`). Only ISO-shaped strings are rewritten; DD-MM-YYYY expense strings and non-dates pass through untouched. Exported from the package index. - Display wiring: `ListCellRenderer` catch-all + inline-dialog cells, `InlineRefField`, and `applyDisplayFormat` template interpolation (ISO-shaped values auto-format). - **`x-edit-as` mechanism**: new `FieldConfig.editAs`; `DateField` renders a `date-time` field with `x-edit-as: date` as a plain date input, normalizes inbound values to `YYYY-MM-DD`, and submits `T00:00:00`. Routing sites unchanged. ### App - `fetch-requests.models.ts`: `SourceType` gains `"csv"`, new `CsvSource`, create-side union drops `FileSource`. - `FetchRequestCreate.tsx`: two-pane grid layout (explicit field partitioning, grid stretch for equal heights), fixed backdrop layer, local `GlassPanel` helper, list rows restyled; `created_at` pinned right before row actions. - `ReportList.tsx`: generated date right-aligned before action buttons; outer row no longer wraps. - `ReportViewer.tsx`: header timestamp formatted via exported `formatDateTime`. ## Verification - `tsc -b` clean at every commit. - Formatter behavior spot-checked: `2026-08-24T09:07:25.168000` → `24 Aug 2026, 09:07`; `01-05-2026` unchanged; `Z`-suffixed UTC converts to local wall time. ## Deploy notes - Pairs with the khata-app MR (same branch name): backend supplies the Source oneOf (pdf/xlsx/csv/email), `trust_fallback`, and `x-edit-as` annotations consumed here. - No dependency changes; no API changes client-side beyond honoring existing spec extensions. Reviewed-on: #18 Co-authored-by: Vishesh 'ironeagle' Bangotra <aetoskia@gmail.com> Co-committed-by: Vishesh 'ironeagle' Bangotra <aetoskia@gmail.com>
23 lines
1.6 KiB
TypeScript
23 lines
1.6 KiB
TypeScript
export { AppProvider } from "./src/context/AppProvider";
|
|
export { Admin, ProfileRoutes } from "./src/components/Admin";
|
|
export type { AdminProps, ProfileRoute } from "./src/components/Admin";
|
|
export { useAppContext } from "./src/context/AppContext";
|
|
export { useResource } from "./src/context/useResource";
|
|
export { ListCellRenderer, DetailFieldRenderer, applyDisplayFormat } from "./src/components/fields";
|
|
export { FormFieldRenderer } from "./src/components/fields/FormFieldRenderer";
|
|
export { MultiEnumField } from "./src/components/fields/renderers/MultiEnumField";
|
|
export { extractFields } from "./src/transformers/field-config";
|
|
export { useFkFieldOptions } from "./src/hooks/useFkFieldOptions";
|
|
export type { FkOption } from "./src/hooks/useFkFieldOptions";
|
|
export { CurrencyField, formatCurrency } from "./src/components/fields/renderers/CurrencyField";
|
|
export { FkMultiSelectField } from "./src/components/fields/renderers/FkMultiSelectField";
|
|
export { SseStreamView } from "./src/components/SseStreamView";
|
|
export { SseConnectionStatus } from "./src/components/SseConnectionStatus";
|
|
export { getApi } from "./src/hooks/useApi";
|
|
export { useItemSse } from "./src/hooks/useItemSse";
|
|
export { sanitizePayload } from "./src/utils/sanitize-payload";
|
|
export type { FkResolver } from "./src/utils/sanitize-payload";
|
|
export { formatDate, formatDateTime } from "./src/utils/datetime";
|
|
export type { FilterComponentProps } from "./src/context/useResource";
|
|
export type { SpecConfiguration, ResourceConfig, FieldConfig, FKFieldConfig, ResourceRelationship, ProfileOperation, ProfileComponents, AuthConfig } from "./src/types";
|