PageSourceSearch

https://app.apploye.com/js/index.n81tjxx4.js

js apploye.com collected 2026-10-03 20:37:56 UTC 9,935 bytes, 1 lines download raw bytes

1import{d as G}from"./vendor.redux.n4s6m3gs.js";import{h as Q}from"./sampleDataSurfaceProps.lovzvkf6.js";import{r as p,j as e}from"./vendor.react-core.le68qx2x.js";import{H as Z}from"./headerWithFiltersContainer.ev0ti8w2.js";import{C as J}from"./ComponentCircleLoader.hbon7sc9.js";import{ag as B,bQ as K,bR as ee,bS as te,N as oe,bT as ne,bU as M,X as re,bV as ie,bW as se,bX as ae,bY as le,bZ as ce,b_ as de,b$ as me,c0 as pe}from"./index.bgvsf1g2.js";import{B as xe}from"./BottomPagination.grlfh5bj.js";import{T as ue}from"./TopPagination.epa9romj.js";import{e as m,cA as F,W as L,aT as he,c3 as _,c4 as fe,b$ as ge,ag as je,X as Ce,g as be,h as ye,P as ke,ak as Te,a as v,C as D,f as $}from"./app.styled.l2grmqhk.js";import{c2 as Ne,c3 as Se,cP as z,cS as Ee,cR as A}from"./index.ef8ymf6t.js";import{d as Pe}from"./delete.mbueuka9.js";import{E as We}from"./edit.izh7xitj.js";import{M as R,a as w}from"./vendor.ui-bootstrap.int9xzr3.js";import{h as P}from"./vendor.moment.gq907bg6.js";import{m as De}from"./ReactSelectDropdown.igrqsuho.js";import"./vendor.misc.jyz1km6f.js";import"./vendor.prop-types.bdehd87k.js";import"./vendor.lightgallery.js.gm1w3blq.js";import"./shared.knyn4b3g.js";import"./vendor.moment-timezone.le8d7pxi.js";import"./vendor.styling.i74dgc25.js";import"./vendor.react-router.j9vxo68w.js";import"./vendor.lucide-react.gdsfvh0n.js";import"./vendor.react-spinners.h9k4muqd.js";import"./vendor.classnames.c1zjbwwq.js";import"./vendor.react-player.8hmaqhfb.js";import"./lazyLoad.hfahqf0t.js";import"./journeyTypes.nzlefoui.js";import"./vendor.radix-ui.ekmd66d4.js";import"./button.m6b3nno0.js";import"./vendor.query-string.i9rz0i7b.js";import"./vendor.react-select-async-paginate.ns5vditx.js";import"./vendor.react-select.nogfkb7y.js";import"./DropdownLoader.degey9nr.js";import"./vendor.react-joyride.l15bcayo.js";import"./vendor.papaparse.pe87q6g4.js";import"./vendor.react-day-picker.j76cmv3t.js";import"./vendor.date-fns.mfcmjmmr.js";import"./motionUtils.kgj1mg2g.js";import"./vendor.framer-motion.d2a5sspj.js";import"./onboardingStyles.lng3octz.js";import"./vendor.use-debounce.fh5ng3uv.js";import"./authStyles.fcx4s7hl.js";import"./vendor.forms.bmyv2n2q.js";import"./iconRegistry.k25hn89d.js";import"./vendor.countries-and-timezones.ot5iyrd9.js";import"./vendor.react-custom-scrollbars-2.pfb7wc7g.js";import"./app.icons.d3xbb3xl.js";import"./privateRoute.kskqhcj2.js";import"./vendor.tanstack_react-query.lj9kqzyo.js";import"./vendor.react-dates.fmvi8jnk.js";import"./vendor.charts.fn6ohj09.js";import"./vendor.lottiefiles_dotlottie-react.np07ka8y.js";import"./vendor.tanstack_react-virtual.itf5qo6f.js";import"./arrow-right-black.nmviuxt0.js";import"./vendor.react-slider.d4w1mb88.js";import"./vendor.react-helmet-async.m07d68kz.js";import"./vendor.react-big-calendar.iml3qwqq.js";import"./vendor.react-datepicker.crdshiyp.js";import"./vendor.axios.mgqcvj5n.js";import"./vendor.posthog.h6ln1v6k.js";import"./vendor.base-64.kwyucbbb.js";import"./vendor.react-gtm-module.ezierfpz.js";import"./vendor.react-oauth_google.joyjqyaj.js";const _e=({isOpen:i,toggle:r,handleDelete:t,isLoading:c})=>{const x=p.useCallback(()=>{c||t()},[t,c]);return e.jsx(R,{isOpen:i,toggle:r,style:{marginTop:"25vh"},children:e.jsxs(w,{style:{padding:"20px"},children:[e.jsx(m,{style:{paddingLeft:"15px"},children:"Are you sure you want to delete this work note?"}),e.jsx(m,{style:{paddingLeft:"15px",paddingTop:"10px",fontSize:"13px",color:"#666"},children:"This will only delete the note. The timesheet entry will remain unchanged."}),e.jsxs(F,{children:[e.jsx(L,{type:"cancel",onClick:r,children:"Cancel"}),e.jsx(he,{type:"delete",padding:c?"0 15px":"0 30px",onClick:()=>x(),children:c?e.jsx(B,{loadingText:"Deleting",fontSize:"13px"}):"Delete Note"})]})]})})},Ie=({isOpen:i,toggle:r,handleUpdate:t,isLoading:c,initialContent:x,note:d,apiError:b})=>{const[g,u]=p.useState(""),[a,h]=p.useState({});p.useEffect(()=>{i&&x?(u(x),h({})):i||(u(""),h({}))},[i,x]);const y=n=>{if(!n)return null;const s=n.includes("Ensure this field has no more than"),N=n.includes("characters");if(s&&N){const l=n.match(/Ensure this field has no more than (\d+) characters/);if(l&&l[1])return`Notes must not contain more than ${l[1]} characters`}return n};p.useEffect(()=>{if(b){const n=y(b);h({note:n})}},[b]);const k=n=>{u(n.target.value),h({})},j=()=>{r(),u(""),h({})},C=()=>{const n={};let s=!0;return g.trim()?Ne(g)?(s=!1,n.note="Note can not contain URL."):Se(g)&&(s=!1,n.note="Invalid note text."):(s=!1,n.note="Note can not be empty."),h(n),s},T=()=>{C()&&t(g)},f=()=>{if(d&&d.timesheet){const n=d.timesheet.start_timestamp,s=d.timesheet.end_timestamp;if(n&&s){const N=P.isMoment(n)?n:P.unix(n),l=P.isMoment(s)?s:P.unix(s);return`${N.format("h:mm a")} - ${l.format("h:mm a")}`}}return null};return e.jsx(R,{isOpen:i,toggle:j,style:{marginTop:"20vh"},children:e.jsxs(w,{style:{padding:"30px"},children:[e.jsxs(_,{gap:"30px",children:[e.jsxs(fe,{children:[e.jsx(ge,{fontSize:"16px",children:"Edit Note"}),f()&&e.jsx(m,{children:f()}),e.jsx(je,{onClick:j,children:e.jsx(Ce,{src:De,alt:""})})]}),e.jsx(be,{text:"Description",cols:"40",rows:"6",value:g,placeholder:"Write your note here...",style:{borderRadius:"6px",padding:"10px"},height:"120px",onChange:n=>k(n),error:a&&a.note&&a.note!==void 0}),a&&a.note&&a.note!==void 0&&e.jsx(ye,{margin:"-20px 0 0 5px",children:a.note})]}),e.jsxs(F,{style:{paddingTop:"30px"},children:[e.jsx(L,{type:"cancel",onClick:j,children:"Cancel"}),e.jsx(ke,{disabled:!g,onClick:T,children:c?e.jsx(B,{loadingText:"Updating",fontSize:"13px"}):"Update Note"})]})]})})},Me=i=>{const{index:r,note:t,selectedMemberId:c,selectedOrganization:x,onDeleteClick:d,onEditClick:b}=i,g=localStorage.getItem("date_format"),u=localStorage.getItem("user_id"),a=z(t.user),h=z(t.created_by),y=()=>x?!!(x.role==="owner"||x.role==="admin"||x.role==="team_leader"||t.user.id===u||t.created_by&&t.created_by.id===u||t.project&&t.project.managed===!0):!1,k=y,j=()=>y(),C=f=>{f.stopPropagation(),d&&d(t)},T=f=>{f.stopPropagation(),b&&b(t)};return e.jsxs(ne,{children:[e.jsxs(M,{children:[e.jsxs(v,{gap:"12px",margin:"0 0 30px 0",children:[e.jsx(re,{member:t.user,imageSize:"36px",fontSize:"13px"}),e.jsx(m,{fontSize:"14px",children:c!==t.user.id?Ee(t.user.id,a):a})]}
1),e.jsxs(_,{gap:"15px",children:[e.jsxs(D,{columns:"80px auto",justifyContent:"flex-start",gap:"10px",children:[e.jsx(m,{fontSize:"14px",$label:!0,fontWeight:"500",margin:"0",children:"Project"}),e.jsx(m,{fontSize:"14px",margin:"0",title:t.project?t.project.name:"",children:t.project?A(t.project.name,50):"-"})]}),t.task&&e.jsxs(D,{columns:"80px auto",justifyContent:"flex-start",gap:"10px",children:[e.jsx(m,{fontSize:"14px",$label:!0,fontWeight:"500",margin:"0",children:"Task"}),e.jsx(m,{fontSize:"14px",margin:"0",title:t.task.name,children:A(t.task.name,70)})]})]}),e.jsxs(D,{columns:"80px auto",justifyContent:"flex-start",gap:"10px",margin:"15px 0 0",children:[e.jsx(m,{fontSize:"14px",$label:!0,fontWeight:"500",margin:"0",children:"Timesheet"}),e.jsx(m,{fontSize:"14px",margin:"0",children:`${t.timesheet.start_timestamp.format("hh:mm A")} - ${t.timesheet.end_timestamp.format("hh:mm A")}`})]})]}),e.jsx(M,{children:e.jsxs(_,{children:[e.jsxs(v,{gap:"10px",alignItems:"start",children:[e.jsx(m,{fontWeight:"700",children:"Note"}),e.jsx(ie,{index:r,radius:"40px",children:e.jsx(m,{fontSize:"11.5px",children:`${t.timestamp.format("hh:mm A")} | ${t.timestamp.format(g)}`})}),t.created_by&&t.user.id!==t.created_by.id?e.jsx(se,{margin:"0",backgroundColor:"#EEF1F7",radius:"40px",color:"#444",children:`Added by ${t.created_by.id===u?"You":h}`}):null]}),e.jsx(m,{fontSize:"13px",margin:"8px 0 0",textAlign:"justify",children:t.content})]})}),(j()||k())&&e.jsxs(ae,{children:[j()&&e.jsx(le,{onClick:T,title:"Edit note",children:e.jsx($,{src:We,alt:"Edit"})}),k()&&e.jsx(ce,{onClick:C,title:"Delete note",children:e.jsx($,{src:Pe,alt:"Delete"})})]})]},t.id)},ve=({isLoading:i,workNotes:r,pageSize:t,totalNotesCount:c,selectedMemberId:x,selectedOrganization:d,deleteWorkNote:b,updateWorkNote:g,isDeleting:u,isUpdating:a,updateError:h})=>{const[y,k]=p.useState(1),j=p.useRef(null),[C,T]=p.useState(!1),[f,n]=p.useState(!1),[s,N]=p.useState(null),[l,E]=p.useState(null),W=(t&&c?Math.ceil(c/t):0)>=2,U=o=>{o.currentPageNumber!==void 0&&k(o.currentPageNumber),o.setCurrentPageNumber&&(j.current=o.setCurrentPageNumber)},I=o=>{k(o),j.current&&j.current(o)},H=o=>{N(o),T(!0)},V=o=>{E(o),n(!0)},X=()=>{if(s&&d?.id){const o={organization_id:d?.id,note_id:s.id};b(o)}},O=o=>{if(l&&d?.id){const S={organization_id:d?.id,note_id:l.id,content:o};g(S)}},Y=()=>{T(!C),C||N(null)},q=()=>{n(!f),f||E(null)};return p.useEffect(()=>{!u&&C&&s&&(r.some(S=>S.id===s.id)||(T(!1),N(null)))},[u,r,C,s]),p.useEffect(()=>{if(!a&&f&&l&&!h){const o=r.find(S=>S.id===l.id);o&&o.content!==l.content&&(n(!1),E(null))}},[a,r,f,l,h]),e.jsxs("div",{className:"content",children:[e.jsx(Z,{module:"worknotes",title:"Work Notes",uniqueProps:{onFilterChange:U},page:"worknotes"}),e.jsxs(K,{$withTopPagination:W,children:[W?e.jsx(ue,{itemName:"notes",totalCount:c,currentPage:y,onPageChange:o=>I(o),pageSize:t,margin:"0"}):null,e.jsx(Te,{marginTop:"0px",padding:"30px",children:i?e.jsx(J,{}):r&&r.length>0?e.jsx(ee,{children:r.map((o,S)=>e.jsx(Me,{index:S,note:o,selectedMemberId:x,selectedOrganization:d,onDeleteClick:H,onEditClick:V},o.id))}):e.jsx(te,{children:e.jsx(oe,{title:"No work notes found.",padding:"0"})})}),W?e.jsx(xe,{totalCount:c,currentPage:y,onPageChange:o=>I(o),pageSize:t}):null]}),e.jsx(_e,{isOpen:C,toggle:Y,handleDelete:X,isLoading:u}),e.jsx(Ie,{isOpen:f,toggle:q,handleUpdate:O,isLoading:a,initialContent:l?.content||"",note:l,apiError:h})]})},$e=i=>({selectedMemberId:i.report.selectedMemberId,selectedOrganization:i.organization.selectedOrganization,...Q(i)}),ze=i=>({deleteWorkNote:r=>i(pe(r)),updateWorkNote:r=>i(me(r)),getWorkNotes:r=>i(de(r))}),Yt=G($e,ze)(ve);export{Yt 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.