mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 11:08:12 +00:00
fix: consolidate stamp settings into single company stamp page
This commit is contained in:
@@ -51,8 +51,7 @@ import { NO_ACCESS_PATH, resolveLandingPath } from "./lib/landing";
|
|||||||
import NoAccessPage from "./pages/NoAccessPage";
|
import NoAccessPage from "./pages/NoAccessPage";
|
||||||
import FileUploadSettingsPage from "./pages/documents/FileUploadSettingsPage";
|
import FileUploadSettingsPage from "./pages/documents/FileUploadSettingsPage";
|
||||||
import DropdownSettingsPage from "./pages/dropdown_settings/DropdownSettingsPage";
|
import DropdownSettingsPage from "./pages/dropdown_settings/DropdownSettingsPage";
|
||||||
import StampSettings from "./record-management/components/Settings/uploadTeeterandSingature";
|
import CompanyStampSettingsPage from "./pages/settings/CompanyStampSettingsPage";
|
||||||
import InvoiceStampSettingsPage from "./pages/settings/InvoiceStampSettingsPage";
|
|
||||||
import ContractTemplatesPage from "./pages/contract_templates/ContractTemplatesPage";
|
import ContractTemplatesPage from "./pages/contract_templates/ContractTemplatesPage";
|
||||||
import PortalContentPage from "./pages/portal_content/PortalContentPage";
|
import PortalContentPage from "./pages/portal_content/PortalContentPage";
|
||||||
import ContractTemplateEditorPage from "./pages/contract_templates/ContractTemplateEditorPage";
|
import ContractTemplateEditorPage from "./pages/contract_templates/ContractTemplateEditorPage";
|
||||||
@@ -786,24 +785,28 @@ const App = () => {
|
|||||||
</RequirePermission>
|
</RequirePermission>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
{/*
|
||||||
|
The ONE company stamp, for every generated document. The per-officer
|
||||||
|
teeter (ማህተም) that used to sit beside it at /dashboard/stamp-settings
|
||||||
|
now lives at /user-management/teeter-and-signature — it is a different
|
||||||
|
thing (an individual's approval stamp), and pairing the two here was
|
||||||
|
the duplication.
|
||||||
|
*/}
|
||||||
<Route
|
<Route
|
||||||
path="stamp-settings"
|
path="stamp-settings"
|
||||||
element={
|
|
||||||
<RequirePermission permission={FREIGHT_PERMS.settings.stamp.view}>
|
|
||||||
<StampSettings />
|
|
||||||
</RequirePermission>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<Route
|
|
||||||
path="invoice-stamp-settings"
|
|
||||||
element={
|
element={
|
||||||
<RequirePermission
|
<RequirePermission
|
||||||
permission={FREIGHT_PERMS.settings.invoiceStamp.view}
|
permission={FREIGHT_PERMS.settings.invoiceStamp.view}
|
||||||
>
|
>
|
||||||
<InvoiceStampSettingsPage />
|
<CompanyStampSettingsPage />
|
||||||
</RequirePermission>
|
</RequirePermission>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
{/* Old URL kept alive so existing links/bookmarks do not 404. */}
|
||||||
|
<Route
|
||||||
|
path="invoice-stamp-settings"
|
||||||
|
element={<Navigate to="/dashboard/stamp-settings" replace />}
|
||||||
|
/>
|
||||||
<Route
|
<Route
|
||||||
path="contract-templates"
|
path="contract-templates"
|
||||||
element={
|
element={
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import {
|
|||||||
PackageOpen,
|
PackageOpen,
|
||||||
Paperclip,
|
Paperclip,
|
||||||
Receipt,
|
Receipt,
|
||||||
|
Stamp,
|
||||||
ScrollText,
|
ScrollText,
|
||||||
Send,
|
Send,
|
||||||
Settings,
|
Settings,
|
||||||
@@ -486,15 +487,12 @@ export const buildSidebarSections = (demoItems: SidebarItem[]): SidebarSection[]
|
|||||||
permission: FREIGHT_PERMS.settings.dropdown.view,
|
permission: FREIGHT_PERMS.settings.dropdown.view,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Stamp settings",
|
// One entry, one stamp. The former "Stamp settings" entry here pointed
|
||||||
|
// at the per-officer teeter (ማህተም), not a company seal — it moved to
|
||||||
|
// /user-management/teeter-and-signature.
|
||||||
|
label: "Company stamp",
|
||||||
href: "/dashboard/stamp-settings",
|
href: "/dashboard/stamp-settings",
|
||||||
icon: <FileSignature />,
|
icon: <Stamp />,
|
||||||
permission: FREIGHT_PERMS.settings.stamp.view,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Invoice stamp",
|
|
||||||
href: "/dashboard/invoice-stamp-settings",
|
|
||||||
icon: <Receipt />,
|
|
||||||
permission: FREIGHT_PERMS.settings.invoiceStamp.view,
|
permission: FREIGHT_PERMS.settings.invoiceStamp.view,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,10 +17,16 @@ import {
|
|||||||
} from "@/hooks/useStampSettings";
|
} from "@/hooks/useStampSettings";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The one company stamp/seal stamped onto every generated invoice/receipt
|
* The ONE company stamp/seal, read by every document path server-side via
|
||||||
* PDF (InvoiceDocumentService). Single global image — no per-employee choice.
|
* StampSettingsService: invoices and receipts (InvoiceDocumentService),
|
||||||
|
* warehouse release + handover papers, and the EDR side of contract signature
|
||||||
|
* blocks. Single global image — no per-employee choice, and staff never upload
|
||||||
|
* one when signing.
|
||||||
|
*
|
||||||
|
* Not to be confused with the per-officer teeter (ማህተም) at
|
||||||
|
* /user-management/teeter-and-signature, which is genuinely per-person.
|
||||||
*/
|
*/
|
||||||
export default function InvoiceStampSettingsPage() {
|
export default function CompanyStampSettingsPage() {
|
||||||
const { data, isLoading } = useStampSettingsQuery();
|
const { data, isLoading } = useStampSettingsQuery();
|
||||||
const setStamp = useSetStamp();
|
const setStamp = useSetStamp();
|
||||||
const clearStamp = useClearStamp();
|
const clearStamp = useClearStamp();
|
||||||
@@ -47,11 +53,13 @@ export default function InvoiceStampSettingsPage() {
|
|||||||
<div className="p-4 w-full max-w-screen-sm mx-auto">
|
<div className="p-4 w-full max-w-screen-sm mx-auto">
|
||||||
<Card className="shadow-lg border-gray-200 dark:border-gray-700">
|
<Card className="shadow-lg border-gray-200 dark:border-gray-700">
|
||||||
<CardHeader>
|
<CardHeader>
|
||||||
<CardTitle>Invoice stamp</CardTitle>
|
<CardTitle>Company stamp</CardTitle>
|
||||||
<CardDescription>
|
<CardDescription>
|
||||||
Stamped onto every generated invoice and receipt PDF. Replacing it
|
The single EDR seal, applied to every generated document — invoices
|
||||||
here changes it everywhere at once — there is no per-invoice or
|
and receipts, warehouse release and handover papers, and the EDR
|
||||||
per-user choice.
|
side of signed contracts. Replacing it here changes it everywhere at
|
||||||
|
once; there is no per-document, per-invoice or per-employee choice.
|
||||||
|
Staff do not upload their own.
|
||||||
</CardDescription>
|
</CardDescription>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent className="space-y-4">
|
<CardContent className="space-y-4">
|
||||||
@@ -3,7 +3,7 @@ import { Navigate, Outlet, Route } from "react-router-dom";
|
|||||||
|
|
||||||
import { useAuth } from "@/auth/useAuth";
|
import { useAuth } from "@/auth/useAuth";
|
||||||
import { NO_ACCESS_PATH, resolveLandingPath } from "@/lib/landing";
|
import { NO_ACCESS_PATH, resolveLandingPath } from "@/lib/landing";
|
||||||
import { isSuperAdmin } from "@/lib/permissions";
|
import { FREIGHT_PERMS, isSuperAdmin } from "@/lib/permissions";
|
||||||
import { WithPermission } from "@/shared/hooks/useHas";
|
import { WithPermission } from "@/shared/hooks/useHas";
|
||||||
import PendingExternalUsers from "@/super-admin/components/externalUsers/PendingExternalUsers";
|
import PendingExternalUsers from "@/super-admin/components/externalUsers/PendingExternalUsers";
|
||||||
import TemplatePage from "@/super-admin/components/templates/components/templates";
|
import TemplatePage from "@/super-admin/components/templates/components/templates";
|
||||||
@@ -44,6 +44,8 @@ import { SidebarProvider } from "@/shared/common/ui/sidebar";
|
|||||||
import { AuthProvider as UmAuthProvider } from "@/shared/context/AuthContext";
|
import { AuthProvider as UmAuthProvider } from "@/shared/context/AuthContext";
|
||||||
import { PermissionProvider } from "@/shared/context/PermissionContext";
|
import { PermissionProvider } from "@/shared/context/PermissionContext";
|
||||||
import UserManagementPage from "@/pages/UserManagementPage";
|
import UserManagementPage from "@/pages/UserManagementPage";
|
||||||
|
import { RequirePermission } from "@/components/auth/RequirePermission";
|
||||||
|
import UploadTeeterAndSignature from "@/record-management/components/Settings/uploadTeeterandSingature";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provider shell for the vendored IAM UI. Feeds its Auth + Permission contexts
|
* Provider shell for the vendored IAM UI. Feeds its Auth + Permission contexts
|
||||||
@@ -138,6 +140,25 @@ export function UserManagementRoutes(): ReactElement {
|
|||||||
path="user-management/position-management"
|
path="user-management/position-management"
|
||||||
element={<PositionManagementPage />}
|
element={<PositionManagementPage />}
|
||||||
/>
|
/>
|
||||||
|
{/*
|
||||||
|
The per-officer teeter (ማህተም) + signature upload. This
|
||||||
|
is NOT the company stamp: it is the individual approval
|
||||||
|
stamp a record officer applies to records, locale-aware
|
||||||
|
(am/en) and genuinely per-person. It used to sit at
|
||||||
|
/dashboard/stamp-settings under Settings, next to the
|
||||||
|
single global company stamp, which read as duplication.
|
||||||
|
Permission gate unchanged from that route.
|
||||||
|
*/}
|
||||||
|
<Route
|
||||||
|
path="user-management/teeter-and-signature"
|
||||||
|
element={
|
||||||
|
<RequirePermission
|
||||||
|
permission={FREIGHT_PERMS.settings.stamp.view}
|
||||||
|
>
|
||||||
|
<UploadTeeterAndSignature />
|
||||||
|
</RequirePermission>
|
||||||
|
}
|
||||||
|
/>
|
||||||
<Route
|
<Route
|
||||||
path="user-management/migrated-records-management"
|
path="user-management/migrated-records-management"
|
||||||
element={<MigratedDataManagementPage />}
|
element={<MigratedDataManagementPage />}
|
||||||
|
|||||||
Reference in New Issue
Block a user