PageSourceSearch

https://telekonzultace.cz/assets/VoucherCodePane-DnedZhl2.js

js telekonzultace.cz collected 2026-10-08 22:10:41 UTC 23,699 bytes, 1 lines download raw bytes

1import{r as L,b as P,o as v,j as e,S as X,N as oe,T as t,g as s,W as R,Y as J,bg as A,L as $,B as W,c as Q,aB as ee,am as te,a8 as Y,a6 as M,X as re,a as ie,a7 as B,Z as ne,v as ce,x as U,w as de,M as E,P as z,I as T,a5 as he,az as ue,aM as me,s as pe}from"./index-3nz_226j.js";import{S as Ce}from"./Search-CIwShgaR.js";import{R as ge}from"./RemotePagingTable-C58AK4J4.js";import{m as je}from"./final-form-arrays.es-CrKXkBGD.js";import{F as xe}from"./react-final-form-arrays.es-B1HKkyXp.js";import{F as V}from"./Form-Uxno0HT8.js";import{V as Z}from"./VCDateTimePicker-BnlQPFKm.js";import{d as I}from"./DefaultObjects-hlNictR4.js";import{U as be}from"./UserActionsList-Ckb0mIgm.js";import{J as De,a as fe}from"./definitions-BxdomEwy.js";import"./TextArea-DLde93QM.js";import"./date-time-utils-BsbmUZr5.js";import"./Card-Byon-wmo.js";import"./loopWordings-C0MLUlCT.js";const Se=({onSubmit:j,values:l=null,onCancel:a=null})=>{const i={...l||I},[o]=L.useState(!i.code),n=P("Global.format_date_time","DD.MM.YYYY HH:mm");i.hasOwnProperty("startDateDisabled")||(i.startDate?(i.startDateDisabled=!1,i.startDate=v(new Date(i.startDate),n)):i.startDateDisabled=I.startDateDisabled),i.hasOwnProperty("endDateDisabled")||(i.endDate?(i.endDateDisabled=!1,i.endDate=v(new Date(i.endDate),n)):i.endDateDisabled=I.endDateDisabled);const f=({initialValues:r,handleSubmit:d,pristine:F,submitting:p,invalid:k,_hasValidationErrors:O,_errors:ve,modifiedSinceLastSubmit:se,_hasSubmitErrors:Te,_submitError:Pe,values:y,form:ae,onCancel:K})=>{const le=()=>{ae.reset(r),typeof K=="function"&&!o&&K()};return e.jsx(V,{id:"managerVoucherCodeForm",loading:p,onSubmit:d,children:e.jsx(t,{stackable:!0,striped:!0,children:e.jsxs(t.Body,{children:[o&&e.jsxs(t.Row,{className:"objectDisplayField",children:[e.jsx(t.Cell,{className:"objectDisplayFieldLabel",width:3,children:s("VoucherCodes.code","Code")}),e.jsx(t.Cell,{className:"objectDisplayFieldValue",width:4,children:e.jsx(R,{name:"code",children:({input:C,meta:g})=>{const{value:h,onChange:x,onFocus:u,onBlur:S}=C,{error:m,touched:b,dirty:w}=g,D=!!m&&(b||w);return e.jsx(V.Input,{fluid:!0,type:"text",className:"full",placeholder:s("VoucherCodes.code","Code"),value:h,onChange:N=>x(N.nativeEvent.target.value),onFocus:u,onBlur:S,error:D?{content:m,pointing:"left"}:!1})}})}),e.jsx(t.Cell,{className:"objectDisplayFieldValue",width:9,children:e.jsx("p",{style:{paddingLeft:"5px"},children:s("VoucherCodes.codeLengthHint","Wenn kein Code angegeben ist, wird ein Code mit der angegebenen Länge generiert (Minimum 5 Zeichen).")})})]}),o&&e.jsxs(t.Row,{className:"objectDisplayField",children:[e.jsx(t.Cell,{className:"objectDisplayFieldLabel",width:3,children:s("VoucherCodes.codeLengthToCreate","Länge des zu erzeugenden Codes")}),e.jsx(t.Cell,{className:"objectDisplayFieldValue",width:13,colSpan:"2",children:e.jsx(R,{name:"codeLength",children:({input:C,meta:g})=>{const{value:h,onChange:x,onFocus:u,onBlur:S}=C,{error:m,touched:b,dirty:w}=g,D=!!m&&(b||w);return e.jsx(V.Input,{fluid:!0,type:"number",className:"third",min:"5",max:"99",placeholder:s("VoucherCodes.codeLengthToCreate","Länge des zu erzeugenden Codes"),disabled:!!y.code,value:y.code&&y.code!==""?y.code.length:h,onChange:N=>x(N.nativeEvent.target.value),onFocus:u,onBlur:S,error:D?{content:m,pointing:"left"}:!1})}})})]}),o&&e.jsxs(t.Row,{className:"objectDisplayField",children:[e.jsx(t.Cell,{className:"objectDisplayFieldLabel",width:3,children:s("VoucherCodes.amountToCreate","Anzahl anzulegender Codes")}),e.jsx(t.Cell,{className:"objectDisplayFieldValue",width:13,colSpan:"2",children:e.jsx(R,{name:"amount",children:({input:C,meta:g})=>{const{value:h,onChange:x,onFocus:u,onBlur:S}=C,{error:m,touched:b,dirty:w}=g,D=!!m&&(b||w);return e.jsx(V.Input,{fluid:!0,type:"number",className:"third",min:"1",max:"999999",placeholder:s("VoucherCodes.amountToCreate","Anzahl anzulegender Codes"),disabled:!!y.code,value:y.code&&y.code!==""?1:h,onChange:N=>x(N.nativeEvent.target.value),onFocus:u,onBlur:S,error:D?{content:m,pointing:"left"}:!1})}})})]}),e.jsxs(t.Row,{className:"objectDisplayField",children:[e.jsx(t.Cell,{className:"objectDisplayFieldLabel",width:3,children:s("VoucherCodes.provider","Anbieter")}),e.jsx(t.Cell,{className:"objectDisplayFieldValue",width:13,colSpan:"2",children:e.jsx(R,{name:"provider",children:({input:C,meta:g})=>{const{value:h,onChange:x,onFocus:u,onBlur:S}=C,{error:m,touched:b,dirty:w}=g,D=!!m&&(b||w);return e.jsx(V.Input,{fluid:!0,type:"text",className:"half",placeholder:s("VoucherCodes.provider","Anbieter"),value:h,onChange:N=>x(N.nativeEvent.target.value),onFocus:u,onBlur:S,error:D?{content:m,pointing:"left"}:!1})}})})]}),e.jsxs(t.Row,{className:"objectDisplayField",children:[e.jsxs(t.Cell,{className:"objectDisplayFieldLabel",width:3,children:[s("VoucherCodes.setStartDate","Startzeitpunkt festlegen"),"?"]}),e.jsx(t.Cell,{className:"objectDisplayFieldValue",width:13,colSpan:"2",children:e.jsx(R,{name:"startDateDisabled",children:({input:C})=>{const{value:g,onChange:h}=C;return e.jsx(V.Field,{label:{children:y.startDateDisabled?s("Global.No","Nein"):s("Global.Yes","Ja")},checked:!g,onChange:(x,{checked:u})=>h(!u),control:J})}})})]}),!y.startDateDisabled&&e.jsxs(t.Row,{className:"objectDisplayField",children:[e.jsx(t.Cell,{className:"objectDisplayFieldLabel",width:3,children:s("VoucherCodes.startDate","Gültig ab")}),e.jsx(t.Cell,{className:"objectDisplayFieldValue",width:13,colSpan:"2",children:e.jsx(R,{name:"startDate",children:({input:C,meta:g})=>{const{value:h,onChange:x}=C,{error:u,touched:S,dirty:m}=g,b=!!u&&(S||m),w=h?A(h,n):null;return e.jsxs(V.Field,{className:"half datepicker",error:b,children:[e.jsx(Z,{ampm:P("Global.dateTime.AMPM","false")==="true",value:w,onChange:D=>x(D)}),b&&e.jsx($,{prompt:!0,pointing:"left",children:u})]})}})})]}),e.jsxs(t.Row,{className:"objectDisplayField",children:[e.jsxs(t.Cell,{className:"objectDisplayFieldLabel",width:3,children:[s("VoucherCodes.setEndDate","Endzeitpunkt festlegen"),"?"]}),e.jsx(t.Cell,{className:"objectDisplayFieldValue",width:13,colSpan:"2",children:e.jsx(R,{name:"endDateDisabled",children:({input:C})=>{const{value:g,onChange:h}=C;return e.jsx(V.Field,{label:{children:y.endDateDisabled?s("Global.No","Nein"):s("Global.Yes","Ja")},checked:!g,onChange:(x,{checked:u})=>h(!u),control:J})}})})]}),!y.endDateDisabled&&e.jsxs(t.Row,{className:"objectDisplayField",children:[e.jsx(t.Cell,{className:"objectDisplayFieldLabel",width:3,children:s("VoucherCodes.endDate","Gültig bis")}),e.jsx(t.Cell,{className:"objectDisplayFieldValue",width:13,colSpan:"2",children:e.jsx(R,{name:"endDate",children:({input:C,meta:g})=>{const{value:h,onChange:x}=C,{error:u,touched:S,dirty:m}=g,b=!!u&&(S||m),w=h?A(h,n):null;return e.jsxs(V.Field,{className:"half datepicker",error:b,children:[e.jsx(Z,{ampm:P("Global.dateTime.AMPM","false")==="true",value:w,onChange:D=>x((D==null?void 0:D.format(n))||"")}),b&&e.jsx($,{prompt:!0,pointing:"left",children:u})]})}})})]}),e.jsxs(t.Row,{className:"objectDisplayField",children:[e.jsx(t.Cell,{className:"objectDisplayFieldLabel",width:3,children:s("VoucherCodes.maxUsages","max. Nutzerzahl")}),e.jsx(t.Cell,{className:"objectDisplayFieldValue",width:13,colSpan:"2",children:e.jsx(R,{name:"maxUsages",children:({input:C,meta:g})=>{const{value:h,onChange:x,onFocus:u,onBlur:S}=C,{error:m,touched:b,dirty:w}=g,D=!!m&&(b||w);return e.jsx(V.Input,{fluid:!0,type:"number",className:"third",min:"0",max:"999999",placeholder:s("VoucherCodes.maxUsages","max. Nutzerzahl"),value:h,onChange:N=>x(N.nativeEvent.target.value),onFocus:u,onBlur:S,error:D?{content:m,pointing:"left"}:!1})}})})]}),e.jsxs(t.Row,{className:"objectDisplayField",children:[e.jsx(t.Cell,{className:"objectDisplayFieldLabel",width:3,children:s("VoucherCodes.comment","Kommentar")}
1),e.jsx(t.Cell,{className:"objectDisplayFieldValue",width:13,colSpan:"2",children:e.jsx(R,{name:"comment",children:({input:C,meta:g})=>{const{value:h,onChange:x,onFocus:u,onBlur:S}=C,{error:m,touched:b,dirty:w}=g,D=!!m&&(b||w);return e.jsx(V.TextArea,{className:"fullWidth",placeholder:s("VoucherCodes.comment","Kommentar"),value:h,onChange:N=>x(N.nativeEvent.target.value),onFocus:u,onBlur:S,error:D?{content:m,pointing:"left"}:!1})}})})]}),e.jsxs(t.Row,{children:[e.jsx(t.Cell,{width:3,children:s("VoucherCodes.UserActions","Benutzeraktionen")}),e.jsx(t.Cell,{width:13,colSpan:"2",children:e.jsx(xe,{name:"userActions",component:be})})]}),e.jsxs(t.Row,{children:[e.jsx(t.Cell,{width:3}),e.jsxs(t.Cell,{width:13,colSpan:"2",children:[e.jsx(W,{primary:!0,type:"submit",loading:p,disabled:F||k||k&&!se,content:o?s("Global.Create","Erstellen"):s("Global.Save","Speichern")}),e.jsx(W,{type:"button",content:s("Global.Cancel","Abbrechen"),onClick:le})]})]})]})})})},c=r=>{const d={};if((!r.provider||r.provider==="")&&(d.provider=s("FormErrs.txtNotEmpty","Dieses Feld darf nicht leer sein")),(!r.maxUsages&&r.maxUsages!==0||r.maxUsages<0)&&(d.maxUsages=s("FormErrs.positiveNumberZero","Bitte geben Sie eine Zahl größer oder gleich 0 an.")),r.maxUsages>99999&&(d.maxUsages=s("FormErrs.max99999","Bitte geben Sie eine Anzahl von maximal 99999 ein.")),(!r.maxUsages&&r.maxUsages!==0||r.code==="")&&((!r.amount||r.amount<=0)&&(d.amount=s("FormErrs.positiveNumber","Bitte geben Sie eine positive Zahl an. (Mindestens 1)")),r.amount>99999&&(d.amount=s("FormErrs.max99999","Bitte geben Sie eine Anzahl von maximal 99999 ein.")),(!r.codeLength||r.codeLength<=0)&&(d.codeLength=s("FormErrs.positiveNumberMin5","Bitte geben Sie eine Zahl größer oder gleich 5 an")),r.codeLength>99&&(d.codeLength=s("FormErrs.max99","Bitte geben Sie eine Anzahl von maximal 99 ein."))),r.endDateDisabled||r.endDate||(d.endDate=s("FormErrs.VoucherEndDate","Bitte geben Sie ein Enddatum an")),r.startDateDisabled||r.startDate||(d.startDate=s("FormErrs.VoucherStartDate","Bitte geben Sie ein Startdatum an")),!r.endDateDisabled&&!r.startDateDisabled&&r.endDate&&r.startDate){const F=A(r.endDate,n),p=A(r.startDate,n);F.isBefore(p)&&(d.startDate=s("FormErrs.VoucherBeginAfterEnd","Der Startzeitpunkt muss vor dem Endzeitpunkt gesetzt werden."))}return d};return e.jsx(X,{children:e.jsx(oe,{mutators:{...je},onSubmit:j,validate:c,render:f,initialValues:i,onCancel:a})})};class q extends L.Component{constructor(l){super(l),this.state={}}onSubmit(l){var c,r;const{userActions:a,...i}=l,o={...i,userActions:JSON.stringify({userActions:a})};l.startDateDisabled===!0?o.startDate=null:o.startDate=v(l.startDate,P("Global.format_date_time","DD.MM.YYYY HH:mm")),l.endDateDisabled===!0?o.endDate=null:o.endDate=v(l.endDate,P("Global.format_date_time","DD.MM.YYYY HH:mm"));const n=(r=(c=this.props)==null?void 0:c.code)!=null&&r.code?"voucherCodes/update":"voucherCodes/create",f={auth:ee(),...o};te(n,"POST",f,this.saveSuccess.bind(this),this.showError.bind(this))}saveSuccess({data:l}){try{const{success:a,content:{codes:i,code:o}}=l;a&&(i?(i.length===1?this.props.onChange(i[0]):i.length>0?this.props.onChange(i[0]):this.props.showNotification({title:s("Global.save","Speichern"),message:s("VoucherCodes.saveSuccessButNoCodes","Das Speichern war erfolgreich, aber es wurde kein Code zurückgeliefert. Falls die Suche die erstellten Codes nicht findet, wenden Sie sich bitte an den Support."),type:M.WARNING,position:Y.TOP_RIGHT}),i.length>0&&this.props.createResultCallback&&this.props.createResultCallback(i)):o&&this.props.onChange(o),this.props.showNotification({title:s("Global.save","Speichern"),message:s("Labels.manager.Success","Erfolgreich"),type:M.SUCCESS,position:Y.TOP_RIGHT}))}catch(a){re.error("[VoucherCode].saveSuccess",a);const i=a.response&&a.response.data&&a.response.data.errCodes?a.response.data.errCodes[0]:"UNDEFINED",o=ie[i].localizedMessage();B({title:"Speichern",message:o,type:M.ERROR,autoClose:!1,position:Y.TOP_RIGHT})}}showError(l){l.response&&l.response.data&&l.response.data.errCodes&&l.response.data.errCodes[0],this.props.showNotification({title:s("Global.save","Speichern"),message:s("Labels.manager.Failed","fehlgeschlagen"),type:M.ERROR,position:Y.TOP_RIGHT})}render(){const{editMode:l,code:a}=this.props;if(!a)return null;const i=this.props.usageCount?this.props.usageCount:0,o=a.startDate>0?v(a.startDate,P("Global.format_date_time","DD.MM.YYYY HH:mm")):s("Global.noRestriction","Keine Einschränkung"),n=a.endDate>0?v(a.endDate,P("Global.format_date_time","DD.MM.YYYY HH:mm")):s("Global.noRestriction","Keine Einschränkung"),{userActions:f,...c}=a;let r;try{r=JSON.parse(f)}catch{}const d={...c,userActions:(r==null?void 0:r.userActions)||[]},F=[{label:s("Profile.id","Id"),selector:p=>e.jsx(De,{type:fe.USER,id:p.id,display:p.realId})},{label:s("Profile.name","Name"),selector:p=>ne(p)},{label:s("Profile.loginname","Loginname"),selector:"username"},{label:s("Profile.email","E-Mail"),selector:"email"}];return e.jsxs(e.Fragment,{children:[l&&e.jsx(Se,{values:d,onSubmit:this.onSubmit.bind(this),onCancel:()=>this.props.onChange(a)}),!l&&e.jsx(t,{stackable:!0,striped:!0,children:e.jsxs(t.Body,{children:[e.jsxs(t.Row,{className:"objectDisplayField",children:[e.jsx(t.Cell,{className:"objectDisplayFieldLabel",width:3,children:s("VoucherCodes.provider","Anbieter")}),e.jsx(t.Cell,{className:"objectDisplayFieldValue",width:13,children:a.provider})]}),e.jsxs(t.Row,{className:"objectDisplayField",children:[e.jsx(t.Cell,{className:"objectDisplayFieldLabel",width:3,children:s("VoucherCodes.startDate","Gültig von")}),e.jsx(t.Cell,{className:"objectDisplayFieldValue",width:13,children:o})]}),e.jsxs(t.Row,{className:"objectDisplayField",children:[e.jsx(t.Cell,{className:"objectDisplayFieldLabel",width:3,children:s("VoucherCodes.endDate","Gültig bis")}),e.jsx(t.Cell,{className:"objectDisplayFieldValue",width:13,children:n})]}),e.jsxs(t.Row,{className:"objectDisplayField",children:[e.jsxs(t.Cell,{className:"objectDisplayFieldLabel",width:3,children:[s("VoucherCodes.usages","Nutzerzahl"),"(",s("Global.current","aktuell")," /"," ",s("Global.max","max"),")"]}),e.jsxs(t.Cell,{className:"objectDisplayFieldValue",width:13,children:[i," / ",a.maxUsages]})]}),e.jsxs(t.Row,{className:"objectDisplayField",children:[e.jsx(t.Cell,{className:"objectDisplayFieldLabel",width:3,children:s("VoucherCodes.comment","Kommentar")}
1),e.jsx(t.Cell,{className:"objectDisplayFieldValue",width:13,children:a.comment})]})]})}),!l&&e.jsx(X,{children:e.jsx(ge,{columnProps:F,pageSize:10,params:this.state.params,remoteDataFnc:(p,k,O)=>this.requestData(p,k,O)})})]})}requestData(l,a,i){return new Promise((o,n)=>{const f=encodeURIComponent(this.props.code.code);ce({urlPart:`voucherCodes/assignments?voucherCode=${f}&limit=${a}&offset=${i}`,authAsPostValues:!0}).then(c=>{const r=c.data.content.users;o({data:r,limit:a,offset:i,count:this.props.usageCount})}).catch(c=>{n(c)})})}}q.propTypes={code:U.object,usageCount:U.number,editMode:U.bool.isRequired,createResultCallback:U.func.isRequired,onChange:U.func.isRequired};q.defaultProps={usageCount:0};const we=j=>({}),ye={showNotification:B},Ne=Q(we,ye)(q),_=11,G={enterForTable:"enterForTable",object:"object",furtherCount:"furtherCount"},H=5;class Ve extends L.Component{constructor(l){var a;super(l),this.requestTimeout=null,this.state={requestPending:!1,searchResults:[],tableResults:[],usageCounts:{},value:"",listSearchResult:!0,preselectedUUID:(a=l.params)==null?void 0:a.preselectedUUID,selectedCode:null,isCreate:!1,isUpdate:!1,activePage:1,totalPages:1,showDirect:null}}componentDidMount(){this._componentMounted=!0,this.props.query.has("show")&&this.setState({showDirect:this.props.query.get("show")}),this.startSearch()}componentWillUnmount(){this._componentMounted=!1}startSearch(){this.setState({requestPending:!0}),this.requestTimeout=null;const{value:l}=this.state,a="voucherCodes/search?includeCounts=true",i={auth:ee(),needle:l};te(a,"POST",i,o=>{if(this._componentMounted){const n=[];let f={},c=[];o.data.success===!0&&(c=o.data.content.codes,n.push({title:s("Manager.enterToShowAll","Enter-Taste drücken, um alle anzuzeigen."),type:G.enterForTable}),c.forEach((p,k)=>{k<H&&n.push({type:G.object,title:p.code,description:"descr.",item:p})}),c.length>H&&n.push({title:c.length-H+" "+s("Manager.furtherCount","weitere..."),type:G.furtherCount}),f=o.data.content.codeUsageCounts),this.setState({requestPending:!1,searchResults:n,tableResults:c,usageCounts:f,activePage:1,totalPages:Math.floor(c.length/_)+1});const r=this.state.showDirect,d=this.state.preselectedUUID;let F;r&&(F=c.find(p=>p.code===r)),d&&d!==""&&(F=c.find(p=>p.id===d)),F&&(this.viewVoucherCode(F),this.setState({showDirect:null,preselectedUUID:null}))}},o=>{this._componentMounted&&this.setState({requestPending:!1,searchResults:[],tableResults:[],usageCounts:[],activePage:1,totalPages:1})})}handleSearchChange(l,{value:a}){this.requestTimeout&&clearTimeout(this.requestTimeout),this.requestTimeout=setTimeout(this.startSearch.bind(this),500),this.setState({value:a})}handleResultSelect(l,{result:a}){a.type===G.object&&this.viewVoucherCode(a.item)}showCreateResultList(l){this.setState({listSearchResult:!0,selectedCode:null,isCreate:!1,searchResults:[]}),this.startSearch()}getTopMenu(){const{requestPending:l,searchResults:a,value:i,listSearchResult:o,selectedCode:n,isCreate:f,isUpdate:c}=this.state;return e.jsxs(E,{stackable:!0,pointing:!0,children:[o&&e.jsxs(L.Fragment,{children:[e.jsx(E.Item,{className:"searchField",children:e.jsx(Ce,{loading:l,onResultSelect:(r,d)=>this.handleResultSelect(r,d),onSearchChange:this.handleSearchChange.bind(this),results:a,value:i,resultRenderer:Fe,selectFirstResult:!0,size:"small",fluid:!0})}),this.props.settings[z.Admin.updateVoucherCode]&&e.jsxs(E.Item,{onClick:()=>this.newVoucherCode(),children:[e.jsx(T,{name:"add"}),s("VoucherCodes.createCode","Code erstellen")]})]}),o===!1&&n!==null&&!f&&e.jsxs(L.Fragment,{children:[e.jsx(E.Item,{onClick:()=>this.backToList(),children:e.jsx(T,{name:"arrow left"})}),e.jsx(E.Item,{name:"title",children:e.jsxs("h3",{className:"managerSubnavbarTitle",children:[e.jsx(T,{name:"tags"}),n.code]})}),this.props.settings[z.Admin.updateVoucherCode]&&!c&&e.jsxs(E.Item,{name:"editCode",onClick:()=>this.editVoucherCode(),position:"right",color:"blue",children:[e.jsx(T,{name:"edit"}),s("Global.edit","Bearbeiten")]}),this.props.settings[z.Admin.deleteVoucherCode]&&e.jsxs(E.Item,{name:"deleteCode",onClick:()=>this.openDeleteVoucherCodeDialog(),position:"right",color:"red",children:[e.jsx(T,{name:"trash",color:"red"}
1),s("VoucherCodes.Delete","Gutscheincode löschen")]})]}),o===!1&&n!==null&&f&&e.jsxs(L.Fragment,{children:[e.jsx(E.Item,{onClick:()=>this.backToList(),children:e.jsx(T,{name:"arrow left"})}),this.props.settings[z.Admin.updateVoucherCode]&&e.jsx(E.Item,{name:"title",children:e.jsxs("h3",{className:"managerSubnavbarTitle",children:[e.jsx(T,{name:"add"}),s("VoucherCodes.createCode","Code erstellen")]})})]})]})}newVoucherCode(){this.state.selectedCode||this.setState({listSearchResult:!1,selectedCode:I,isCreate:!0,isUpdate:!1})}viewVoucherCode(l){l&&this.setState({selectedCode:l,listSearchResult:!1})}editVoucherCode(){this.state.selectedCode&&this.setState({listSearchResult:!1,isCreate:!1,isUpdate:!0})}backToList(){this.setState({selectedCode:null,listSearchResult:!0,isCreate:!1,isUpdate:!1})}openDeleteVoucherCodeDialog(){const{selectedCode:l}=this.state,a=l==null?void 0:l.code;this.props.updateDialog({title:s("Manager.VoucherCodes.Delete","Gutscheincode löschen")+" "+a,children:e.jsx("p",{children:s("Manager.VoucherCodes.DeleteMsg","Wollen Sie den Gutscheincode wirklich endgültig löschen?")}),modal:!0,ok:!0,cancel:!0,size:"tiny",okFunc:()=>{this.removeVoucherCode(l==null?void 0:l.code)}})}removeVoucherCode(l){l&&he({urlPart:`voucherCodes/delete?voucherCode=${l}`,authAsPostValues:!0,successCallback:()=>{this.props.showNotification({title:s("VoucherCodes.DeleteNotification.Title","Gutscheincode gelöscht"),message:s("VoucherCodes.DeleteNotification.Msg","Gutscheincode wurde erfolgreich gelöscht."),type:M.SUCCESS}),this.setState({listSearchResult:!0,selectedCode:null}),this.startSearch()},errCallback:a=>{a.response&&a.response.data&&a.response.data.messages&&a.response.data.messages[0]&&a.response.data.messages[0].indexOf("ConstraintViolation")!==-1?this.props.showNotification({title:s("VoucherCodes.DeleteNotificationErr.Title","Gutscheincode löschen fehlgeschlagen"),message:s("VoucherCodes.DeleteNotificationErr.MsgAlreadyAssigned","Bereits eingelöste Gutscheine können nicht gelöscht werden."),type:M.ERROR}):this.props.showNotification({title:s("VoucherCodes.DeleteNotificationErr.Title","Gutscheincode löschen fehlgeschlagen"),message:s("VoucherCodes.DeleteNotificationErr.Msg","Gutscheincode konnte nicht gelöscht werden."),type:M.ERROR})}})}getResultList(){const{usageCounts:l,tableResults:a}=this.state,i=a.length<=_?a:a.slice((this.state.activePage-1)*_,this.state.activePage*_);return e.jsxs("div",{className:"managerUiTable",children:[e.jsxs(t,{selectable:!0,padded:!1,striped:!0,children:[e.jsx(t.Header,{children:e.jsxs(t.Row,{children:[e.jsx(t.HeaderCell,{children:s("VoucherCodes.code","Code")}),e.jsx(t.HeaderCell,{children:s("VoucherCodes.creationDate","Erstellt am")}),e.jsx(t.HeaderCell,{children:s("VoucherCodes.startDate","Gültig von")}),e.jsx(t.HeaderCell,{children:s("VoucherCodes.endDate","Gültig bis")}),e.jsx(t.HeaderCell,{children:s("VoucherCodes.maxUsages","Nutzerzahl")}),e.jsx(t.HeaderCell,{children:s("VoucherCodes.provider","Anbieter")}),e.jsx(t.HeaderCell,{children:s("VoucherCodes.comment","Kommentar")})]})}),e.jsx(t.Body,{children:this.state.requestPending?e.jsx(t.Row,{children:e.jsx(t.Cell,{colSpan:7,children:e.jsx(ue,{active:!0,inline:"centered"})})}):i.length===0?e.jsx(t.Row,{children:e.jsx(t.Cell,{colSpan:7,children:e.jsx("p",{children:s("Global.noEntries","Keine Einträge")})})}):i.map(o=>{const n=l[o.code]?l[o.code]:0;return e.jsxs(t.Row,{onClick:()=>this.viewVoucherCode(o),children:[e.jsx(t.Cell,{children:e.jsx("p",{children:o.code})}),e.jsx(t.Cell,{children:e.jsx("p",{children:o.creationDate?v(o.creationDate,"DD.MM.YYYY HH:mm"):""})}),e.jsx(t.Cell,{children:e.jsx("p",{children:o.startDate?v(o.startDate,"DD.MM.YYYY HH:mm"):s("Global.noRestriction","Keine Einschränkung")})}),e.jsx(t.Cell,{children:e.jsx("p",{children:o.endDate?v(o.endDate,"DD.MM.YYYY HH:mm"):s("Global.noRestriction","Keine Einschränkung")})}),e.jsx(t.Cell,{children:e.jsxs("p",{children:[n," / ",o.maxUsages]})}),e.jsx(t.Cell,{children:e.jsx("p",{children:o.provider})}),e.jsx(t.Cell,{children:e.jsx("p",{children:o.comment})})]},o.code)})})]}),e.jsx(me,{activePage:this.state.activePage,onPageChange:(o,{activePage:n})=>this.setState({activePage:n}),size:"mini",totalPages:this.state.totalPages})]})}render(){const{selectedCode:l,listSearchResult:a,usageCounts:i,isCreate:o,isUpdate:n}=this.state;return e.jsxs("div",{className:"voucherCodePane",children:[this.getTopMenu(),a&&this.getResultList(),!a&&l!==null&&e.jsx(Ne,{code:l,usageCount:i[l.code],editMode:o||n,createResultCallback:this.showCreateResultList.bind(this),onChange:f=>this.setState({isUpdate:!1,selectedCode:f})})]})}}const Fe=j=>{if(j.type===G.object)return e.jsx("div",{className:"searchFieldResult table",children:e.jsxs("div",{className:"tableRow",children:[e.jsx("div",{className:"tableCell",children:e.jsx("p",{className:"bold",children:j.item.code})}),e.jsxs("div",{className:"tableCell notFirst",children:[e.jsx("p",{children:j.item.provider}),e.jsx("p",{children:j.item.comment})]})]})},j.code);
1if(j.type===G.enterForTable)return e.jsx("div",{children:j.title},j.type);if(j.type===G.furtherCount)return e.jsx("div",{children:j.title},j.type)},Re=j=>({settings:j.settings}),Ee={updateDialog:pe,showNotification:B},Ke=de(Q(Re,Ee)(Ve));export{Ke 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.