PageSourceSearch

https://cdn.joinhomebase.com/assets/RequestsHistoryView-chunk-CPb5fzFE.js

js joinhomebase.com collected 2026-10-01 08:55:51 UTC 6,538 bytes, 2 lines download raw bytes

1import{reactExports as l,jsxRuntimeExports as t}from"./react-core-chunk-B2r03cU8.js";import{Box_default as m,Avatar_default as U,Text_default as b,IconButton_default as j,Tooltip_default as N,Pill_default as z,normalizeTableColumns as F,TableWrapper as Y,PageWithSubcomponents as y,Icon_default as Q,TextInput_default as W,cxHelpers as q,useHistory as k,useLocation as B,withUxRoot as G,PTO_POLICY_ROUTES as Z}from"./app-init-chunk-Cf9dEl-y.js";import{REQUEST_STATUS_PILL as J,useDashboardQueryParams as X,toMonthParam as ee,addMonths as D,parseCalendarDate as ae,toCalendarDate as I,getPeriodLabel as te}from"./useDashboardQueryParams-chunk-DNB4aJEA.js";import{toI18n as s,formatDatePrettyShortWithYear as oe}from"./tracking-chunk-2tlC51DH.js";import{EVENT_CATEGORIES as re,PRODUCT_AREAS as se}from"./app-bundle-kYrKUrz1.js";import{formatDuration as ne,policyLabel as M,truncateNotes as le}from"./useRequestHistoryColumns-chunk-z3RH-Te5.js";import{usePagination as ie}from"./usePagination-chunk-uexSobAT.js";import{useCalendarRequests as ce}from"./useCalendarRequests-chunk-D3TDG2wT.js";try{(function(){var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="666887e9-bfad-43de-8c9d-88c3299c47fe",a._sentryDebugIdIdentifier="sentry-dbid-666887e9-bfad-43de-8c9d-88c3299c47fe")})()}catch{}const n="time_off.requests_history",de=()=>{},_=a=>t.jsx(m,{pv:"xs",children:a}),P=()=>s("time_off.balances_index.no_value"),$=a=>a?.trim()?a:P(),L=a=>a?oe(a):P(),u=a=>_(t.jsx(b,{variant:"bodySmTight",children:a})),A=a=>a?.trim()?`“${a}”`:P(),O=a=>{const e=J[a],r=`${n}.status.${a}`,o=s(r);return{variant:e?.variant??"mono",label:o===r?a:o}},ue=a=>l.useMemo(()=>[{headerKey:"teamMember",headerLabel:s(`${n}.columns.team_member`),rowValues:a.map(e=>_(t.jsxs(m,{row:!0,vcenter:!0,gap:"sm",children:[t.jsx(U,{image:e.avatar_url??void 0,alt:e.employee_name,size:"small"}),t.jsx(b,{variant:"bodySmTight",children:e.employee_name})]}))),rawRowValues:a.map(e=>e.employee_name)},{headerKey:"startDate",headerLabel:s(`${n}.columns.start_date`),rowValues:a.map(e=>u(L(e.start_at))),rawRowValues:a.map(e=>e.start_at)},{headerKey:"endDate",headerLabel:s(`${n}.columns.end_date`),rowValues:a.map(e=>u(L(e.end_at))),rawRowValues:a.map(e=>e.end_at)},{headerKey:"requestedOn",headerLabel:s(`${n}.columns.requested_on`),rowValues:a.map(e=>u(L(e.created_at))),rawRowValues:a.map(e=>e.created_at)},{headerKey:"duration",headerLabel:s(`${n}.columns.duration`),rowValues:a.map(e=>u(ne(e.duration_in_hours))),rawRowValues:a.map(e=>e.duration_in_hours)},{headerKey:"policyType",headerLabel:s(`${n}.columns.policy_type`),rowValues:a.map(e=>u(M(e.category_name))),rawRowValues:a.map(e=>M(e.category_name))},{headerKey:"reason",headerLabel:s(`${n}.columns.reason`),rowValues:a.map(e=>{const r=A(e.notes),o=le(r);return _(t.jsx(N,{content:o!==r?r:null,children:t.jsx(m,{children:t.jsx(b,{variant:"bodySmTight",children:o})})}))}),rawRowValues:a.map(e=>A(e.notes))},{headerKey:"reviewer",headerLabel:s(`${n}.columns.reviewer`),rowValues:a.map(e=>u($(e.responder_name))),rawRowValues:a.map(e=>$(e.responder_name))},{headerKey:"status",headerLabel:s(`${n}.columns.status`),rowValues:a.map(e=>{const{variant:r,label:o}=O(e.state);return _(t.jsx(z,{variant:r,children:o}))}),rawRowValues:a.map(e=>O(e.state).label)},{headerKey:"actions",headerLabel:"",rowValues:a.map(()=>_(t.jsx(j,{icon:"MoreVertical",size:"small",label:s(`${n}.actions_label`),onClick:de,uxElement:"requests_history_overflow"}))),rawRowValues:a.map(e=>e.id)}],[a]),me=({requests:a,isLoading:e=!1,currentPage:r=1,numberPages:o=1,onPage:c})=>{const i=ue(a),h=l.useMemo(()=>F(i),[i]);return t.jsx(Y,{columns:h,loading:e,hideUnsortedSortArrows:!0,wrapInPageCard:!1,...o>1&&c&&{pagination:{currentPage:r,numberPages:o,onPage:c}}})},{cxEl:he}=q("RequestsHistoryToolbar"),_e=({back:a,search:e,onSearchChange:r,monthLabel:o,onPreviousMonth:c,onNextMonth:i})=>t.jsx(y.Toolbar,{back:a,filters:t.jsx(m,{maxw:280,children:t.jsx(W,{name:"requests-history-search",ariaLabel:s("time_off.requests_history.search_label"),startIcon:"Search",placeholder:s("time_off.requests_history.search_placeholder"),value:e,onCh
1ange:r})}),context:t.jsxs(m,{row:!0,vcenter:!0,gap:"xs",children:[t.jsx(j,{icon:"ChevronLeft",label:s("time_off.requests_dashboard.period.previous"),onClick:c,uxElement:"requests_history_previous_month"}),t.jsxs(m,{className:he("month"),row:!0,vcenter:!0,gap:"xs",children:[t.jsx(Q,{iconName:"Calendar",color:"secondary",size:"small"}),t.jsx(b,{variant:"body",children:o})]}),t.jsx(j,{icon:"ChevronRight",label:s("time_off.requests_dashboard.period.next"),onClick:i,uxElement:"requests_history_next_month"})]})}),pe=25,fe=a=>{const e=ae(a);return{startDate:I(new Date(e.getFullYear(),e.getMonth(),1)),endDate:I(new Date(e.getFullYear(),e.getMonth()+1,0))}},ye=(a,e)=>a.employee_name?.toLowerCase().includes(e)??!1,be=({search:a})=>{const e=k(),{search:r}=B(),{month:o}=X(),c=l.useMemo(()=>fe(o),[o]),{requests:i,isLoading:h,isRefreshing:g,isError:w,retry:x}=ce(c),d=a.trim().toLowerCase(),R=l.useMemo(()=>d?i.filter(v=>ye(v,d)):i,[i,d]),{pageItems:p,currentPage:T,numberPages:C,setCurrentPage:S,resetPagination:V}=ie(R,{perPage:pe});l.useEffect(()=>{V()},[o,d,V]);const f=l.useCallback(v=>{const E=new URLSearchParams(r);E.set("month",ee(v)),E.delete("day"),e.replace({search:E.toString()})},[e,r]),H=l.useCallback(()=>f(D(o,-1)),[f,o]),K=l.useCallback(()=>f(D(o,1)),[f,o]);return{month:o,goToPreviousMonth:H,goToNextMonth:K,requests:p,currentPage:T,numberPages:C,setCurrentPage:S,isLoading:h,isRefreshing:g,isError:w,retry:x}},ge="en-US",we=1,xe=()=>{const a=k(),[e,r]=l.useState(""),{month:o,goToPreviousMonth:c,goToNextMonth:i,requests:h,isLoading:g,isRefreshing:w,currentPage:x,numberPages:d,setCurrentPage:R}=be({search:e}),p=document.documentElement.lang||ge,T=l.useMemo(()=>te(o,"month",p,we),[o,p]),C=l.useCallback(S=>r(S.target.value),[]);return t.jsx(y,{title:s("time_off.requests_history.title"),children:t.jsx(y.Subpage,{back:{hideLabelInToolbar:!0,onClick:()=>a.push(`${Z.REQUESTS_DASHBOARD}?view=list`)},toolbar:t.jsx(_e,{search:e,onSearchChange:C,monthLabel:T,onPreviousMonth:c,onNextMonth:i}),children:t.jsx(y.Card,{children:t.jsx(me,{requests:h,isLoading:g||w,currentPage:x,numberPages:d,onPage:R})})})})},Pe=G({productArea:se.PTO,eventCategory:re.TIME_OFFS})(xe);export{Pe as default};
2//# sourceMappingURL=RequestsHistoryView-chunk-CPb5fzFE.js.map

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.