PageSourceSearch

https://boombam.app/assets/content-workflow-CpN-7VI3.js

js boombam.app collected 2026-10-04 13:33:09 UTC 13,733 bytes, 1 lines download raw bytes

1import{_ as ce,r,a as y,a6 as b,j as e,B as u,bZ as E,aH as oe,C as c,c as L,E as z,cn as G,ak as de,cb as xe,aD as he,al as me,am as ue,an as pe,e as x,b as H,d as W,q as ge,F,aE as je,aF as X,$ as T,a0 as S,a1 as k,a2 as A,a3 as h,v as ye,w as be,U as ve,V as fe,aC as Ne,aG as we,ab as v,ap as Ce,s as M,a7 as f,bG as o}from"./index-CuSEeJFb.js";import{T as Te,a as Se,b as N,c as w}from"./tabs-CcPOXtvT.js";import{S as ke,e as Ae,a as qe,b as De,c as Me}from"./sheet-veaLBARn.js";import{R as Re}from"./rotate-ccw-Tvprt-zs.js";import{C as Fe}from"./circle-check-DSSdNCFx.js";import{R as Ie}from"./rocket-DokzAs0d.js";import{f as C}from"./format-hhvI2L0z.js";import"./en-US-BOoww7nS.js";const R={draft:{label:"Draft",color:"bg-gray-100 text-gray-800",icon:F},in_review:{label:"In Review",color:"bg-blue-100 text-blue-800",icon:z},needs_revision:{label:"Needs Revision",color:"bg-yellow-100 text-yellow-800",icon:Re},approved:{label:"Approved",color:"bg-green-100 text-green-800",icon:Fe},deployed:{label:"Deployed",color:"bg-purple-100 text-purple-800",icon:Ie},completed:{label:"Completed",color:"bg-emerald-100 text-emerald-800",icon:Ne},rejected:{label:"Rejected",color:"bg-red-100 text-red-800",icon:G},archived:{label:"Archived",color:"bg-gray-100 text-gray-600",icon:we}},Z={low:{label:"Low",color:"bg-gray-100 text-gray-600"},medium:{label:"Medium",color:"bg-blue-100 text-blue-700"},high:{label:"High",color:"bg-orange-100 text-orange-700"},urgent:{label:"Urgent",color:"bg-red-100 text-red-700"}},I={email:{label:"Email",icon:"📧"},social_post:{label:"Social Post",icon:"📱"},blog_post:{label:"Blog Post",icon:"📝"},ad_copy:{label:"Ad Copy",icon:"🎯"},landing_page:{label:"Landing Page",icon:"🖥️"},video_script:{label:"Video Script",icon:"🎬"},campaign_strategy:{label:"Campaign Strategy",icon:"📊"},design_asset:{label:"Design Asset",icon:"🎨"},document:{label:"Document",icon:"📄"},presentation:{label:"Presentation",icon:"📊"}};function Pe({onSubmit:p,isLoading:g}){const[n,i]=r.useState({title:"",description:"",contentType:"blog_post",priority:"medium",requiresReview:!0,requiresApproval:!0,dueDate:""}),q=s=>{s.preventDefault(),p(n)};return e.jsxs("form",{onSubmit:q,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(v,{htmlFor:"title",children:"Title"}),e.jsx(X,{id:"title","data-testid":"input-content-title",value:n.title,onChange:s=>i({...n,title:s.target.value}),placeholder:"Enter content title",required:!0})]}),e.jsxs("div",{children:[e.jsx(v,{htmlFor:"description",children:"Description"}),e.jsx(Ce,{id:"description","data-testid":"textarea-content-description",value:n.description,onChange:s=>i({...n,description:s.target.value}),placeholder:"Brief description of the content"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(v,{htmlFor:"contentType",children:"Content Type"}),e.jsxs(T,{value:n.contentType,onValueChange:s=>i({...n,contentType:s}),children:[e.jsx(S,{"data-testid":"select-content-type",children:e.jsx(k,{})}),e.jsx(A,{children:Object.entries(I).map(([s,j])=>e.jsx(h,{value:s,children:j.label},s))})]})]}),e.jsxs("div",{children:[e.jsx(v,{htmlFor:"priority",children:"Priority"}),e.jsxs(T,{value:n.priority,onValueChange:s=>i({...n,priority:s}),children:[e.jsx(S,{"data-testid":"select-priority",children:e.jsx(k,{})}),e.jsx(A,{children:Object.entries(Z).map(([s,j])=>e.jsx(h,{value:s,children:j.label},s))})]})]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("label",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",checked:n.requiresReview,onChange:s=>i({...n,requiresReview:s.target.checked})}),"Requires Review"]}),e.jsxs("label",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",checked:n.requiresApproval,onChange:s=>i({...n,requiresApproval:s.target.checked})}),"Requires Approval"]})]}),e.jsx(u,{type:"submit",disabled:g,"data-testid":"button-create-content",children:g?"Creating...":"Create Content"})]})}function Ee(){const{toast:p}=ce(),[g,n]=r.useState("dashboard"),[i,q]=r.useState("all"),[s,j]=r.useState("all"),[P,J]=r.useState("all"),[D,Y]=r.useState(""),[d,K]=r.useState(null),[ee,_]=r.useState(!1),[te,se]=r.useState(!1),{data:l}=y({queryKey:["/api/workflow-dashboard"]}),{data:ae=[]}=y({queryKey:["/api/content-items",{status:i,assignedTo:s,contentType:P}]}),{data:$=[]}=y({queryKey:["/api/workflow-alerts",{status:"pending"}]});y({queryKey:["/api/content-items",d==null?void 0:d.id,"actions"],enabled:!!(d!=null&&d.id)});const Q=b({mutationFn:t=>f("POST","/api/content-items"),onSuccess:()=>{o.invalidateQueries({queryKey:["/api/content-items"]}),o.invalidateQueries({queryKey:["/api/workflow-dashboard"]}),_(!1),p({title:"✅ Content Created",description:"Content item has been created and added to the workflow."})}});b({mutationFn:({id:t,...a})=>f("PUT",`/api/content-items/${t}`),onSuccess:()=>{o.invalidateQueries({queryKey:["/api/content-items"]}),o.invalidateQueries({queryKey:["/api/workflow-dashboard"]}),o.invalidateQueries({queryKey:["/api/workflow-alerts"]}),p({title:"✅ Content Updated",description:"Content item has been updated successfully."})}});const ne=b({mutationFn:t=>f("PUT",`/api/workflow-alerts/${t}/read`),onSuccess:()=>{o.invalidateQueries({queryKey:["/api/workflow-alerts"]})}}),le=b({mutationFn:t=>f("PUT",`/api/workflow-alerts/${t}/dismiss`),onSuccess:()=>{o.invalidateQueries({queryKey:["/api/workflow-alerts"]})}}),ie=t=>{Q.mutate(t)},B=ae.filter(t=>!(D&&!t.title.toLowerCase().includes(D.toLowerCase()))),O=t=>{const a=R[t];if(!a)return e.jsx(M,{variant:"outline",children:t});const m=a.icon;return e.jsxs(M,{className:L("flex items-center gap-1",a.color),children:[e.jsx(m,{className:"h-3 w-3"}),a.label]})},U=t=>{const a=Z[t];return e.jsx(M,{variant:"outline",className:a.color,children:a.label})},V=t=>{const a=I[t];return e.jsx("span",{className:"text-lg",title:a.label,children:a.icon})};return e.jsx("div",{className:"min-h-screen bg-gray-50 p-4",children:e.jsxs("div",{className:"max-w-7xl mx-auto",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Content Workflow"}),e.jsx("p",{className:"text-gray-600",children:"Manage content creation and approval workflows"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(ke,{open:te,onOpenChange:se,children:[e.jsx(Ae,{asChild:!0,children:e.jsxs(u,{variant:"outline",size:"icon",className:"relative","data-testid":"button-alerts",children:[e.jsx(E,{className:"h-4 w-4"}),(l==null?void 0:l.pendingAlertsCount)&&l.pendingAlertsCount>0&&e.jsx("span",{className:"absolute -top-1 -right-1 h-4 w-4 bg-red-500 text-white text-xs rounded-full flex items-center justify-center",children:l.pendingAlertsCount})]})}),e.jsxs(qe,{children:[e.jsx(De,{children:e.jsx(Me,{children:"Workflow Alerts"})}),e.jsx(oe,{className:"h-full mt-4",children:e.jsxs("div",{className:"space-y-3",children:[$.map(t=>e.jsx(c,{className:L("p-3",t.severity==="urgent"&&"border-orange-200 bg-orange-50",t.severity==="critical"&&"border-red-200 bg-red-50"),"data-testid":`alert-${t.id}`,children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-medium text-sm",children:t.title}),e.jsx("p",{className:"text-xs text-gray-600 mt-1",children:t.message}),t.actionRequired&&e.jsxs("p",{className:"text-xs text-blue-600 mt-1 font-medium",children:["Action: ",t.actionRequired]}),e.jsx("p",{className:"text-xs text-gray-400 mt-2",children:C(new Date(t.createdAt),"MMM d, h:mm a")})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(u,{size:"sm",variant:"ghost",onClick:()=>ne.mutate(t.id),"data-testid":`button-alert-read-${t.id}`,children:e.jsx(z,{className:"h-3 w-3"})}),e.jsx(u,{size:"sm",variant:"ghost",onClick:()=>le.mutate(t.id),"data-testid":`button-alert-dismiss-${t.id}`,children:e.jsx(G,{className:"h-3 w-3"})})]})]})},t.id)),$.length===0&&e.jsxs("div",{className:"text-center py-8 text-gray-500",children:[e.jsx(E,{className:"h-12 w-12 mx-auto mb-3 text-gray-300"}),e.jsx("p",{children:"No pending alerts"})]})]})})]})]}),e.jsxs(de,{open:ee,onOpenChange:_,children:[e.jsx(xe,{asChild:!0,children:e.jsxs(u,{className:"bg-orange-500 hover:bg-orange-600","data-testid":"button-create-new-content",children:[e.jsx(he,{className:"h-4 w-4 mr-2"}),"Create Content"]})}),e.jsxs(me,{className:"max-w-2xl",children:[e.jsx(ue,{children:e.jsx(pe,{children:"Create New Content Item"})}),e.jsx(Pe,{onSubmit:ie,isLoading:Q.isPending})]})]})]})]}),e.jsxs(Te,{value:g,onValueChange:n,children:[e.jsxs(Se,{className:"grid w-full grid-cols-4",children:[e.jsx(N,{value:"dashboard","data-testid":"tab-dashboard",children:"Dashboard"}),e.jsx(N,{value:"content","data-testid":"tab-content",children:"All Content"}),e.jsx(N,{value:"my-tasks","data-testid":"tab-my-tasks",children:"My Tasks"}),e.jsx(N,{value:"analytics","data-testid":"tab-analytics",children:"Analytics"})]}),e.jsxs(w,{value:"dashboard",className:"space-y-6",children:[e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:Object.entries((l==null?void 0:l.statusCounts)||{}).map(([t,a])=>{const m=R[t];if(!m)return null;const re=m.icon;return e.jsx(c,{"data-testid":`status-card-${t}`,children:e.jsx(x,{className:"p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-600",children:m.label}),e.jsx("p",{className:"text-2xl font-bold","data-testid":`status-count-${t}`,children:a})]}),e.jsx(re,{className:"h-8 w-8 text-gray-400"})]})})},t)})}),e.jsxs(c,{children:[e.jsx(H,{children:e.jsxs(W,{className:"flex items-center gap-2",children:[e.jsx(ge,{className:"h-5 w-5"}),"My Recent Items"]})}),e.jsx(x,{children:e.jsxs("div",{className:"space-y-3",children:[l==null?void 0:l.my
1Items.map(t=>e.jsxs("div",{className:"flex items-center justify-between p-3 border rounded-lg hover:bg-gray-50 cursor-pointer",onClick:()=>K(t),"data-testid":`recent-item-${t.id}`,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[V(t.contentType),e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium",children:t.title}),e.jsx("p",{className:"text-sm text-gray-600",children:C(new Date(t.updatedAt),"MMM d, h:mm a")})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[U(t.priority),O(t.status)]})]},t.id)),!(l!=null&&l.myItems.length)&&e.jsxs("div",{className:"text-center py-8 text-gray-500",children:[e.jsx(F,{className:"h-12 w-12 mx-auto mb-3 text-gray-300"}),e.jsx("p",{children:"No content items yet"})]})]})})]})]}),e.jsxs(w,{value:"content",className:"space-y-6",children:[e.jsx(c,{children:e.jsx(x,{className:"p-4",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(je,{className:"h-4 w-4"}),e.jsx(X,{placeholder:"Search content...",value:D,onChange:t=>Y(t.target.value),className:"w-64","data-testid":"input-search-content"})]}),e.jsxs(T,{value:i,onValueChange:q,children:[e.jsx(S,{className:"w-40","data-testid":"select-filter-status",children:e.jsx(k,{placeholder:"Status"})}),e.jsxs(A,{children:[e.jsx(h,{value:"all",children:"All Status"}),Object.entries(R).map(([t,a])=>e.jsx(h,{value:t,children:a.label},t))]})]}),e.jsxs(T,{value:P,onValueChange:J,children:[e.jsx(S,{className:"w-40","data-testid":"select-filter-content-type",children:e.jsx(k,{placeholder:"Content Type"})}),e.jsxs(A,{children:[e.jsx(h,{value:"all",children:"All Types"}),Object.entries(I).map(([t,a])=>e.jsx(h,{value:t,children:a.label},t))]})]})]})})}),e.jsxs(c,{children:[e.jsx(H,{children:e.jsx(W,{children:"Content Items"})}),e.jsx(x,{children:e.jsxs("div",{className:"space-y-3",children:[B.map(t=>e.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg hover:bg-gray-50 cursor-pointer",onClick:()=>K(t),"data-testid":`content-item-${t.id}`,children:[e.jsxs("div",{className:"flex items-center gap-4",children:[V(t.contentType),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-medium",children:t.title}),e.jsx("p",{className:"text-sm text-gray-600",children:t.description}),e.jsxs("div",{className:"flex items-center gap-4 mt-2 text-xs text-gray-500",children:[e.jsxs("span",{children:["Created ",C(new Date(t.createdAt),"MMM d")]}),t.dueDate&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ye,{className:"h-3 w-3"}),"Due ",C(new Date(t.dueDate),"MMM d")]}),e.jsxs("span",{children:[t.revisionCount," revisions"]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[U(t.priority),O(t.status),e.jsx(be,{className:"h-4 w-4 text-gray-400"})]})]},t.id)),B.length===0&&e.jsxs("div",{className:"text-center py-8 text-gray-500",children:[e.jsx(F,{className:"h-12 w-12 mx-auto mb-3 text-gray-300"}),e.jsx("p",{children:"No content items found"})]})]})})]})]}),e.jsx(w,{value:"my-tasks",children:e.jsx(c,{children:e.jsxs(x,{className:"p-8 text-center",children:[e.jsx(ve,{className:"h-12 w-12 mx-auto mb-4 text-gray-300"}),e.jsx("h3",{className:"text-lg font-medium mb-2",children:"My Tasks"}),e.jsx("p",{className:"text-gray-600",children:"Tasks assigned to you will appear here"})]})})}),e.jsx(w,{value:"analytics",children:e.jsx(c,{children:e.jsxs(x,{className:"p-8 text-center",children:[e.jsx(fe,{className:"h-12 w-12 mx-auto mb-4 text-gray-300"}),e.jsx("h3",{className:"text-lg font-medium mb-2",children:"Workflow Analytics"}),e.jsx("p",{className:"text-gray-600",children:"Analytics and performance metrics coming soon"})]})})})]})]})})}export{Ee 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.