PageSourceSearch

https://taxease360.ai/assets/SuperPlatformTools-AlSlcgU_.js

js taxease360.ai collected 2026-10-05 14:25:48 UTC 4,111 bytes, 3 lines download raw bytes

1import{u as v,r as i,j as e,T as R,S as p,q as h,p as b,C as S}from"./index-CfXbMZ_V.js";import{C}from"./chevron-left-BFeklwt6.js";import{D as k}from"./database-OG_PN5-u.js";import{W as w}from"./wand-sparkles-Ddi3JnTC.js";function O(){const j=v(),[n,o]=i.useState(!1),[l,d]=i.useState(!1),[c,m]=i.useState(null),[x,g]=i.useState(null),[f,r]=i.useState(""),y=async()=>{var t,a;o(!0),r(""),m(null);try{const s=await b.functions.invoke("seedRbacDefaults",{});m((s==null?void 0:s.data)||s)}catch(s){r(((a=(t=s==null?void 0:s.response)==null?void 0:t.data)==null?void 0:a.error)||(s==null?void 0:s.message)||"Failed to seed")}finally{o(!1)}},N=async()=>{var t,a;if(confirm(`Run the R&K → first organisation migration?
2
3This backfills roles, memberships, offices and organisation_id/office_id stamps on all existing records. It is safe to re-run.`)){d(!0),r(""),g(null);try{const s=await b.functions.invoke("migrateRkToFirstOrganisation",{});g((s==null?void 0:s.data)||s)}catch(s){r(((a=(t=s==null?void 0:s.response)==null?void 0:t.data)==null?void 0:a.error)||(s==null?void 0:s.message)||"Failed to migrate")}finally{d(!1)}}},u=({data:t})=>e.jsxs("div",{className:"rounded-xl bg-emerald-50 border border-emerald-200 p-3 text-xs text-emerald-700 space-y-1 mt-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-semibold",children:[e.jsx(S,{size:14})," Complete"]}),e.jsx("pre",{className:"whitespace-pre-wrap text-[11px] leading-snug",children:JSON.stringify(t,null,2)})]});return e.jsxs("div",{className:"space-y-5 pb-6",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>j("/super"),className:"flex items-center justify-center w-11 h-11 rounded-xl bg-gray-100 hover:bg-gray-200 transition-colors shrink-0","aria-label":"Back",children:e.jsx(C,{size:20,className:"text-gray-700"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-gray-900",children:"Platform tools"}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"One-time setup & migration for multi-tenant RBAC."})]})]}),f&&e.jsxs("div",{className:"p-3 rounded-xl bg-red-50 border border-red-200 text-red-600 text-sm flex gap-2",children:[e.jsx(R,{size:16,className:"shrink-0 mt-0.5"}),f]}),e.jsxs("div",{className:"bg-white border border-gray-100 rounded-2xl p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(p,{size:18,className:"text-violet-600"}),e.jsx("h2",{className:"text-sm font-semibold text-gray-900",children:"Step 1 — Seed RBAC defaults"})]}),e.jsx("p",{className:"text-xs text-gray-500",children:"Creates the global Roles, Permissions, and RolePermission mappings used by the office-isolation engine. Idempotent — safe to re-run."}),e.jsxs("button",{onClick:y,disabled:n,className:"w-full h-11 rounded-xl bg-violet-600 hover:bg-violet-700 text-white font-semibold flex items-center justify-center gap-2 disabled:opacity-50",children:[n?e.jsx(h,{size:16,className:"animate-spin"}):e.jsx(p,{size:16}),n?"Seeding…":"Seed RBAC defaults"]}),c&&e.jsx(u,{data:c})]}),e.jsxs("div",{className:"bg-white border border-gray-100 rounded-2xl p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(k,{size:18,className:"text-violet-600"}),e.jsx("h2",{className:"text-sm font-semibold text-gray-900",children:"Step 2 — Migrate R&K to first organisation"})]}),e.jsxs("p",{className:"text-xs text-gray-500",children:["Backfills Organisation/Office memberships, ClientAssignments, and stamps ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"organisation_id"}),"/",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"office_id"})," on all existing client-scoped records. Run after seeding. Idempotent."]}),e.jsxs("button",{onClick:N,disabled:l,className:"w-full h-11 rounded-xl bg-violet-600 hover:bg-violet-700 text-white font-semibold flex items-center justify-center gap-2 disabled:opacity-50",children:[l?e.jsx(h,{size:16,className:"animate-spin"}):e.jsx(w,{size:16}),l?"Migrating…":"Run migration"]}),x&&e.jsx(u,{data:x})]})]})}export{O as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.