PageSourceSearch

https://mvp-app.billys.gr/static/js/src_pages_community_tasks_add_index_jsx.js?v=dd642e83

js billys.gr collected 2026-10-08 03:18:28 UTC 8,402 bytes, 72 lines download raw bytes

1"use strict";
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9a9d5a77-99a7-52fa-8f74-d914f2dd0af7")}catch(e){}}();
3(self.webpackChunkbillys_app_ui=self.webpackChunkbillys_app_ui||[]).push([["src_pages_community_tasks_add_index_jsx"],{3966:(e,i,t)=>{t.d(i,{A:()=>m});var a=t(9276),s=t(89637),n=t(31854),r=t(80074);const l=(0,t(1529).Ay)(n.z)`
4  position: sticky;
5  /* // NOTE: top is set to 0 because the content is separated from the header based on the ant design layout */
6  top: 0;
7  z-index: 9;
8  /* // TODO: refactor to avoid using negative margins in REDESIGN */
9  margin-top: -1.5625rem;
10  margin-left: -1.5625rem;
11  /* // TODO: margin-right might be creating incocistencies, how big an issue is it? */
12  margin-right: -1.5625rem;
13  border-bottom: 1px solid #F0F0F0;
14  background-color: white;
15  padding-block: 16px !important;
16  padding-inline: 25px;
17
18  .ant-page-header-heading {
19    max-width: 50rem;
20    margin-inline: auto;
21  }
22
23  .ant-page-header-heading-title h2 {
24    margin: 0;
25    font-size: 1.25rem;
26  }
27  
28  .ant-page-header-heading-extra {
29    margin: 0;
30    display: none;
31  }
32
33  .ant-page-header-heading-extra .ant-btn-primary {
34    margin-left: 0;
35  }
36
37  .ant-space {
38    gap: 1rem !important;
39  }
40
41  @media (min-width: ${r.R.SM}) {
42    .ant-page-header-heading-extra {
43      display: block;
44    }
45  }
46`;var d=t(35475),o=t(70579);const{Title:c}=a.o5,m=e=>{let{title:i,titleNode:t,loadingSubmit:n,cancelBtnLink:r,cancelBtnText:m,submitBtnText:u,formRef:g,onBack:p}=e;const x=t?(0,o.jsx)(c,{level:4,className:"mb-0",children:t}):i&&(0,o.jsx)(c,{level:4,className:"mb-0",children:(0,o.jsx)(s.A,{id:i})}),h=r&&u;return(0,o.jsx)(l,{ghost:!1,onBack:p||(()=>window.history.back()),title:x,extra:h?[(0,o.jsx)(d.N_,{to:r,children:(0,o.jsx)(a.$n,{children:(0,o.jsx)(s.A,{id:m})})},"2"),(0,o.jsx)(a.$n,{type:"primary",onClick:()=>{var e;return null===(e=g.current)||void 0===e?void 0:e.submit()},loading:n,"data-testid":"formHeaderPrimary-button",children:(0,o.jsx)(s.A,{id:u})},"1")]:[]})}},39712:(e,i,t)=>{t.d(i,{AddTaskPage:()=>B});var a=t(65043),s=t(73216),n=t(97),r=t(23357),l=t(9276),d=t(89637),o=t(3966),c=t(90896),m=t(78189),u=t(51672),g=t(59271),p=t(78001),x=t(89915),h=t(60446),b=t.n(h),j=t(70579);const{TextArea:k}=l.pd,f=["HIGH","MEDIUM","LOW"],y=["MANAGER_ONLY","ALL"].slice(0,1),A=["MAINTENANCE_WORKS","FINANCIALS_EXPENSES","GENERAL_ASSEMBLY"],v={HIGH:"red",MEDIUM:"orange",LOW:"default"},B=()=>{const{formatMessage:e}=(0,n.A)(),{toastSuccess:i,toastError:t}=(0,g.A)(),h=(0,s.Zp)(),[B]=l.lV.useForm(),T=(0,a.useRef)(),[w,N]=(0,a.useState)(!1),[I,S]=(0,a.useState)(0),[L,_]=(0,a.useState)([]),{isDemo:E,currentBuilding:D}=(0,x.A)(),$=(0,r.P)((e=>e.buildings.currentBuilding.id)),F=E?null===D||void 0===D?void 0:D.id:$;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(o.A,{title:"task.create.title",cancelBtnLink:`${(0,p.A)(F)}/community?tab=tasks`,cancelBtnText:"common.cancel",submitBtnText:"task.create.submit",loadingSubmit:w,formRef:T}),(0,j.jsxs)("div",{className:"my-4 container-fluid",style:{maxWidth:"50rem",marginInline:"auto"},children:[(0,j.jsx)(l.Fc,{type:"info",showIcon:!0,message:(0,j.jsx)(d.A,{id:"task.create.description"}),style:{marginBottom:16}}),(0,j.jsx)(l.Zp,{children:(0,j.jsxs)(l.lV,{ref:T,form:B,layout:"vertical",onFinish:async a=>{N(!0);try{const t={buildingId:F,subject:a.subject,description:a.description||void 0,priority:a.priority,visibility:"MANAGER_ONLY",category:a.category||void 0,notificationDate:a.notificationDate?a.notificationDate.toISOString():void 0,mediaFiles:L};await m.A.createTask(t),i(e({id:"task.create.success"})),h(`${(0,p.A)(F)}/community?tab=tasks`)}catch(r){var s,n;const i=(null===r||void 0===r||null===(s=r.response)||void 0===s||null===(n=s.data)||void 0===n?void 0:n.message)||e({id:"errors.generic"});t(i)}finally{N(!1)}},requiredMark:"optional",initialValues:{visibility:"MANAGER_ONLY"},children:[(0,j.jsx)(l.lV.Item,{name:"subject",label:(0,j.jsx)(d.A,{id:"task.field.subject"}),rules:[{required:!0,message:e({id:"task.field.subject.required"})},{max:70,message:e({id:"task.field.subject.placeholder"})}],children:(0,j.jsx)(l.pd,{maxLength:70,placeholder:e({id:"task.field.subject.placeholder"})})}),(0,j.jsx)(l.lV.Item,{name:"description",label:(0,j.jsxs)("span",{children:[(0,j.jsx)(d.A,{id:"task.field.description"}),(0,j.jsxs)("span",{style:{color:"#999",marginLeft:8},children:[I,"/500"]})]}),rules:[{max:500,message:e({id:"task.field.description.maxLength"})}],children:(0,j.jsx)(k,{rows:4,maxLength:500,showCount:!0,placeholder:e({id:"task.field.description.placeholder"}),onChange:e=>S(e.target.value.length)})}),(0,j.jsx)(l.lV.Item,{name:"priority",label:(0,j.jsx)(d.A,{id:"task.field.priority"}),rules:[{required:!0,message:e({id:"task.field.priority.required"})}],children:(0,j.jsx)(l.sx.Group,{children:(0,j.jsx)(l.$x,{size:"large",children:f.map((i=>(0,j.jsx)(l.sx,{value:i,children:(0,j.jsx)(l.vw,{color:v[i],style:{marginInlineStart:4},children:e({id:`task.priority.${i}`})})},i)))})})}),(0,j.jsx)(l.lV.Item,{name:"visibility",label:(0,j.jsx)(d.A,{id:"task.field.visibility"}),rules:[{required:!0,message:e({id:"task.field.visibility.required"})}],children:(0,j.jsx)(l.sx.Group,{children:(0,j.jsx)(l.$x,{size:"large",children:y.map((i=>(0,j.jsx)(l.sx,{value:i,children:e({id:`task.visibility.${i}`})},i)))})})}),(0,j.jsx)(l.lV.Item,{name:"category",label:(0,j.jsx)(d.A,{id:"task.field.category"}),children:(0,j.jsx)(l.l6,{allowClear:!0,placeholder:e({id:"task.field.category.placeholder"}),options:A.map((i=>({label:e({id:`task.category.${i}`}),value:i})))})}),(0,j.jsx)(l.lV.Item,{name:"notificationDate",label:(0,j.jsx)(d.A,{id:"task.field.notificationDate"}),children:(0,j.jsx)(l.lr,{showTime:{defaultValue:b()("12:00:00","HH:mm:ss")},style:{width:"100%"},placeholder:e({id:"task.field.notificationDate.placeholder"})})}),(0,j.jsx)(l.lV.Item,{label:(0,j.jsx)(d.A,{id:"task.field.file"}),children:(0,j.jsx)(u.A,{mediaFiles:L,singleUpload:!1,accept:"image/jpeg,image/png,.pdf,.xlsx,.xls,.doc,.docx,.txt",onCh
46ange:(i,a)=>{a&&t(e({id:"errors.generic"})),_(i)}})})]})})]}),(0,j.jsx)(c.A,{cancelBtnLink:`${(0,p.A)(F)}/community?tab=tasks`,cancelBtnText:"common.cancel",submitBtnText:"task.create.submit",loadingSubmit:w,formRef:T})]})}},78189:(e,i,t)=>{t.d(i,{A:()=>n});var a=t(5842);const s={getTasks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,a.A)({url:"/tasks",method:"get",params:e})},getTask:e=>(0,a.A)({url:`/tasks/${e}`,method:"get"}),createTask:e=>(0,a.A)({url:"/tasks",method:"post",data:{task:e}}),updateTask:(e,i)=>(0,a.A)({url:`/tasks/${e}`,method:"patch",data:i}),getTaskCalendarDates:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,a.A)({url:"/tasks/calendar",method:"get",params:e})}},n=s},89915:(e,i,t)=>{t.d(i,{A:()=>n});var a=t(23357),s=t(20952);const n=()=>{const e=(0,a.P)((e=>e.buildings.currentBuilding)),i=(0,a.P)((e=>e.apartments.list)),{isDemoMode:t,demoBuilding:n,demoApartments:r,demoPermissions:l}=(0,s.A)();return t?{isDemo:!0,currentBuilding:n||{},apartments:r||[],permissions:l||{}}:{isDemo:!1,currentBuilding:e||{},apartments:i||[],permissions:null}}},90896:(e,i,t)=>{t.d(i,{A:()=>m});var a=t(9276),s=t(89637),n=t(1529),r=t(80074),l=t(31854);const d=(0,n.Ay)(l.z)`
47  padding: 1rem;
48  position: fixed;
49  bottom: 0;
50  left: 0;
51  right: 0;
52  width: 100%;
53  z-index: 9;
54  box-shadow: inset 0px 1px 0px #F0F0F0;
55  background-color: white;
56  
57  .ant-page-header-content {
58    max-width: 800px;
59    padding: 0;
60    display: grid;
61    grid-template-columns: 1fr auto;
62    gap: 0.5rem;
63  }
64  
65  @media (min-width: ${r.R.SM}) {
66    & {
67      display: none;
68    }
69  }
70`;var o=t(35475),c=t(70579);const m=e=>{let{loadingSubmit:i,cancelBtnLink:t,cancelBtnText:n,submitBtnText:r,formRef:l}=e;return(0,c.jsxs)(d,{ghost:!1,children:[(0,c.jsx)(a.$n,{type:"primary",onClick:()=>l.current.submit(),loading:i,children:(0,c.jsx)(s.A,{id:r})},"1"),(0,c.jsx)(o.N_,{to:t,children:(0,c.jsx)(a.$n,{"data-testid":"formFooterPrimary-button",children:(0,c.jsx)(s.A,{id:n})})},"2")]})}}}]);
71//# sourceMappingURL=src_pages_community_tasks_add_index_jsx.js.map?v=dd642e83
72//# debugId=9a9d5a77-99a7-52fa-8f74-d914f2dd0af7

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.