mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-24 22:48:18 +00:00
1 line
11 KiB
JavaScript
Vendored
1 line
11 KiB
JavaScript
Vendored
"use strict";(self["webpackChunkfirefly_iii"]=self["webpackChunkfirefly_iii"]||[]).push([[1505],{1505:(e,a,t)=>{t.r(a),t.d(a,{default:()=>Oe});var s=t(9835);const l={class:"row q-mx-md"},n={class:"col-xl-4 col-lg-6 col-md-12 q-pa-xs"},i={class:"text-h6"},o=(0,s.Uk)("Language and locale "),u={key:0,class:"text-secondary"},c=(0,s._)("span",{class:"far fa-check-circle"},null,-1),d=[c],r={key:1,class:"text-blue"},g=(0,s._)("span",{class:"fas fa-spinner fa-spin"},null,-1),p=[g],h={key:2,class:"text-red"},f=(0,s._)("span",{class:"fas fa-skull-crossbones"},null,-1),m=(0,s.Uk)(),w=(0,s._)("small",null,"Please refresh the page...",-1),b=[f,m,w],k={class:"col-xl-4 col-lg-6 col-md-12 q-pa-xs"},_={class:"text-h6"},F=(0,s.Uk)("Accounts on the home screen "),v={key:0,class:"text-secondary"},y=(0,s._)("span",{class:"far fa-check-circle"},null,-1),x=[y],V={key:1,class:"text-blue"},S=(0,s._)("span",{class:"fas fa-spinner fa-spin"},null,-1),z=[S],O={key:2,class:"text-red"},P=(0,s._)("span",{class:"fas fa-skull-crossbones"},null,-1),q=(0,s.Uk)(),W=(0,s._)("small",null,"Please refresh the page...",-1),L=[P,q,W],Z={class:"col-xl-4 col-lg-6 col-md-12 q-pa-xs"},A={class:"text-h6"},U=(0,s.Uk)("View range and list size "),D={key:0,class:"text-secondary"},R=(0,s._)("span",{class:"far fa-check-circle"},null,-1),T=[R],C={key:1,class:"text-blue"},I=(0,s._)("span",{class:"fas fa-spinner fa-spin"},null,-1),Q=[I],B={key:2,class:"text-red"},K=(0,s._)("span",{class:"fas fa-skull-crossbones"},null,-1),N=(0,s.Uk)(),j=(0,s._)("small",null,"Please refresh the page...",-1),E=[K,N,j],M={class:"col-xl-4 col-lg-6 col-md-12 q-pa-xs"},G={class:"text-h6"},$=(0,s.Uk)("Optional transaction fields "),H={key:0,class:"text-secondary"},J=(0,s._)("span",{class:"far fa-check-circle"},null,-1),X=[J],Y={key:1,class:"text-blue"},ee=(0,s._)("span",{class:"fas fa-spinner fa-spin"},null,-1),ae=[ee],te={key:2,class:"text-red"},se=(0,s._)("span",{class:"fas fa-skull-crossbones"},null,-1),le=(0,s.Uk)(),ne=(0,s._)("small",null,"Please refresh the page...",-1),ie=[se,le,ne];function oe(e,a,t,c,g,f){const m=(0,s.up)("q-card-section"),w=(0,s.up)("q-select"),y=(0,s.up)("q-card"),S=(0,s.up)("q-input"),P=(0,s.up)("q-tab"),q=(0,s.up)("q-tabs"),W=(0,s.up)("q-option-group"),R=(0,s.up)("q-tab-panel"),I=(0,s.up)("q-tab-panels"),K=(0,s.up)("q-page");return(0,s.wg)(),(0,s.j4)(K,null,{default:(0,s.w5)((()=>[(0,s._)("div",l,[(0,s._)("div",n,[(0,s.Wm)(y,{bordered:""},{default:(0,s.w5)((()=>[(0,s.Wm)(m,null,{default:(0,s.w5)((()=>[(0,s._)("div",i,[o,!0===g.isOk.language?((0,s.wg)(),(0,s.iD)("span",u,d)):(0,s.kq)("",!0),!0===g.isLoading.language?((0,s.wg)(),(0,s.iD)("span",r,p)):(0,s.kq)("",!0),!0===g.isFailure.language?((0,s.wg)(),(0,s.iD)("span",h,b)):(0,s.kq)("",!0)])])),_:1}),(0,s.Wm)(m,null,{default:(0,s.w5)((()=>[(0,s.Wm)(w,{"bottom-slots":"",outlined:"",modelValue:g.language,"onUpdate:modelValue":a[0]||(a[0]=e=>g.language=e),"emit-value":"","map-options":"",options:g.languages,label:"I prefer the following language"},null,8,["modelValue","options"])])),_:1})])),_:1})]),(0,s._)("div",k,[(0,s.Wm)(y,{bordered:""},{default:(0,s.w5)((()=>[(0,s.Wm)(m,null,{default:(0,s.w5)((()=>[(0,s._)("div",_,[F,!0===g.isOk.accounts?((0,s.wg)(),(0,s.iD)("span",v,x)):(0,s.kq)("",!0),!0===g.isLoading.accounts?((0,s.wg)(),(0,s.iD)("span",V,z)):(0,s.kq)("",!0),!0===g.isFailure.accounts?((0,s.wg)(),(0,s.iD)("span",O,L)):(0,s.kq)("",!0)])])),_:1}),(0,s.Wm)(m,null,{default:(0,s.w5)((()=>[(0,s.Wm)(w,{"bottom-slots":"",outlined:"",multiple:"","use-chips":"",modelValue:g.accounts,"onUpdate:modelValue":a[1]||(a[1]=e=>g.accounts=e),"emit-value":"","map-options":"",options:g.allAccounts,label:"I want to see these accounts on the dashboard"},null,8,["modelValue","options"])])),_:1})])),_:1})]),(0,s._)("div",Z,[(0,s.Wm)(y,{bordered:""},{default:(0,s.w5)((()=>[(0,s.Wm)(m,null,{default:(0,s.w5)((()=>[(0,s._)("div",A,[U,!0===g.isOk.pageSize?((0,s.wg)(),(0,s.iD)("span",D,T)):(0,s.kq)("",!0),!0===g.isLoading.pageSize?((0,s.wg)(),(0,s.iD)("span",C,Q)):(0,s.kq)("",!0),!0===g.isFailure.pageSize?((0,s.wg)(),(0,s.iD)("span",B,E)):(0,s.kq)("",!0)])])),_:1}),(0,s.Wm)(m,null,{default:(0,s.w5)((()=>[(0,s.Wm)(S,{outlined:"",modelValue:g.pageSize,"onUpdate:modelValue":a[2]||(a[2]=e=>g.pageSize=e),type:"number",step:"1",label:"Page size"},null,8,["modelValue"])])),_:1}),(0,s.Wm)(m,null,{default:(0,s.w5)((()=>[(0,s.Wm)(w,{"bottom-slots":"",outlined:"",modelValue:g.viewRange,"onUpdate:modelValue":a[3]||(a[3]=e=>g.viewRange=e),"emit-value":"","map-options":"",options:g.viewRanges,label:"Default period and view range"},null,8,["modelValue","options"])])),_:1})])),_:1})]),(0,s._)("div",M,[(0,s.Wm)(y,{bordered:""},{default:(0,s.w5)((()=>[(0,s.Wm)(m,null,{default:(0,s.w5)((()=>[(0,s._)("div",G,[$,!0===g.isOk.transactionFields?((0,s.wg)(),(0,s.iD)("span",H,X)):(0,s.kq)("",!0),!0===g.isLoading.transactionFields?((0,s.wg)(),(0,s.iD)("span",Y,ae)):(0,s.kq)("",!0),!0===g.isFailure.transactionFields?((0,s.wg)(),(0,s.iD)("span",te,ie)):(0,s.kq)("",!0)])])),_:1}),(0,s.Wm)(q,{modelValue:g.tab,"onUpdate:modelValue":a[4]||(a[4]=e=>g.tab=e),dense:""},{default:(0,s.w5)((()=>[(0,s.Wm)(P,{name:"date",label:"Date fields"}),(0,s.Wm)(P,{name:"meta",label:"Meta data fields"}),(0,s.Wm)(P,{name:"ref",label:"Reference fields"})])),_:1},8,["modelValue"]),(0,s.Wm)(I,{modelValue:g.tab,"onUpdate:modelValue":a[8]||(a[8]=e=>g.tab=e),animated:"",swipeable:""},{default:(0,s.w5)((()=>[(0,s.Wm)(R,{name:"date"},{default:(0,s.w5)((()=>[(0,s.Wm)(W,{options:g.allTransactionFields.date,type:"checkbox",modelValue:g.transactionFields.date,"onUpdate:modelValue":a[5]||(a[5]=e=>g.transactionFields.date=e)},null,8,["options","modelValue"])])),_:1}),(0,s.Wm)(R,{name:"meta"},{default:(0,s.w5)((()=>[(0,s.Wm)(W,{options:g.allTransactionFields.meta,type:"checkbox",modelValue:g.transactionFields.meta,"onUpdate:modelValue":a[6]||(a[6]=e=>g.transactionFields.meta=e)},null,8,["options","modelValue"])])),_:1}),(0,s.Wm)(R,{name:"ref"},{default:(0,s.w5)((()=>[(0,s.Wm)(W,{options:g.allTransactionFields.ref,type:"checkbox",modelValue:g.transactionFields.ref,"onUpdate:modelValue":a[7]||(a[7]=e=>g.transactionFields.ref=e)},null,8,["options","modelValue"])])),_:1})])),_:1},8,["modelValue"])])),_:1})])])])),_:1})}var ue=t(3918),ce=t(1592),de=t(9167),re=t(3836),ge=t(3555);const pe={name:"Index",mounted(){this.store=(0,ge.S)(),this.isOk={language:!0,accounts:!0,pageSize:!0,transactionFields:!0},this.isLoading={language:!1,accounts:!1,pageSize:!1,transactionFields:!1},this.isFailure={language:!1,accounts:!1,pageSize:!1,transactionFields:!1},this.getLanguages(),this.getLanguage(),this.getAssetAccounts().then((()=>{this.getPreferredAccounts()})),this.getViewRanges().then((()=>{this.getPreferredViewRange()})),this.getPageSize(),this.getOptionalFields()},data(){return{languages:[],allAccounts:[],tab:"date",allTransactionFields:{date:[{label:"Interest date",value:"interest_date"},{label:"Book date",value:"book_date"},{label:"Processing date",value:"process_date"},{label:"Due date",value:"due_date"},{label:"Payment date",value:"payment_date"},{label:"Invoice date",value:"invoice_date"}],meta:[{label:"Notes",value:"notes"},{label:"Location",value:"location"},{label:"Attachments",value:"attachments"}],ref:[{label:"Internal reference",value:"internal_reference"},{label:"Transaction links",value:"links"},{label:"External URL",value:"external_url"},{label:"External ID",value:"external_id"}]},viewRanges:[],isOk:{},isLoading:{},isFailure:{},language:"en_US",viewRange:"1M",pageSize:50,accounts:[],transactionFields:{date:[],meta:[],ref:[]},store:null}},watch:{pageSize:function(e){this.isOk.language=!1,this.isLoading.language=!0,(new ce.Z).put("listPageSize",e).then((()=>{this.store.refreshCacheKey(),this.isOk.pageSize=!0,this.isLoading.pageSize=!1,this.isFailure.pageSize=!1})).catch((()=>{this.isOk.pageSize=!1,this.isLoading.pageSize=!1,this.isFailure.pageSize=!0}))},"transactionFields.date":function(){this.submitTransactionFields()},"transactionFields.meta":function(){this.submitTransactionFields()},"transactionFields.ref":function(){this.submitTransactionFields()},language:function(e){this.isOk.language=!1,this.isLoading.language=!0,(new ce.Z).put("language",e).then((()=>{this.store.refreshCacheKey(),this.isOk.language=!0,this.isLoading.language=!1,this.isFailure.language=!1})).catch((()=>{this.isOk.language=!1,this.isLoading.language=!1,this.isFailure.language=!0}))},accounts:function(e){(new ce.Z).put("frontpageAccounts",e).then((()=>{this.store.refreshCacheKey(),this.isOk.accounts=!0,this.isLoading.accounts=!1,this.isFailure.accounts=!1})).catch((()=>{this.isOk.accounts=!1,this.isLoading.accounts=!1,this.isFailure.accounts=!0}))},viewRange:function(e){(new ce.Z).put("viewRange",e).then((()=>{this.store.refreshCacheKey(),this.isOk.pageSize=!0,this.isLoading.pageSize=!1,this.isFailure.pageSize=!1})).catch((()=>{this.isOk.pageSize=!1,this.isLoading.pageSize=!1,this.isFailure.pageSize=!0}))}},computed:{},methods:{getAssetAccounts:function(){return this.getAssetAccountPage(1)},getAssetAccountPage:function(e){return(new re.Z).list("asset",e,this.getCacheKey).then((a=>{let t=parseInt(a.data.meta.pagination.total_pages);for(let e in a.data.data)if(a.data.data.hasOwnProperty(e)){let t=a.data.data[e];this.allAccounts.push({value:parseInt(t.id),label:t.attributes.name})}t>e&&this.getAssetAccountPage(e+1)}))},submitTransactionFields:function(){let e={};for(let a in this.transactionFields)if(this.transactionFields.hasOwnProperty(a)){let t=this.transactionFields[a];for(let a in t)if(t.hasOwnProperty(a)){let s=t[a];e[s]=!0}}(new ce.Z).put("transaction_journal_optional_fields",e).then((()=>{this.store.refreshCacheKey(),this.isOk.transactionFields=!0,this.isLoading.transactionFields=!1,this.isFailure.transactionFields=!1})).catch((()=>{this.isOk.transactionFields=!1,this.isLoading.transactionFields=!1,this.isFailure.transactionFields=!0}))},getOptionalFields:function(){(new de.Z).getByName("transaction_journal_optional_fields").then((e=>{let a=e.data.data.attributes.data;for(let t in a)for(let e in this.allTransactionFields)if(this.allTransactionFields.hasOwnProperty(e)){let s=this.allTransactionFields[e];for(let l in s)if(s.hasOwnProperty(l)){let n=s[l];t===n.value&&!0===a[t]&&this.transactionFields[e].push(t)}}}))},getLanguage:function(){(new de.Z).getByName("language").then((e=>{this.language=e.data.data.attributes.data}))},getPageSize:function(){(new de.Z).getByName("listPageSize").then((e=>{this.pageSize=e.data.data.attributes.data}))},getPreferredAccounts:function(){(new de.Z).getByName("frontpageAccounts").then((e=>{this.accounts=e.data.data.attributes.data}))},getPreferredViewRange:function(){(new de.Z).getByName("viewRange").then((e=>{this.viewRange=e.data.data.attributes.data}))},getLanguages:function(){let e=new ue.Z;e.get("firefly.languages").then((e=>{let a=e.data.data.value;for(let t in a)if(a.hasOwnProperty(t)){let e=a[t];this.languages.push({value:t,label:e.name_locale+" ("+e.name_english+")"})}}))},getViewRanges:function(){let e=new ue.Z;return e.get("firefly.valid_view_ranges").then((e=>{let a=e.data.data.value;for(let t in a)if(a.hasOwnProperty(t)){let e=a[t];this.viewRanges.push({value:e,label:this.$t("firefly.pref_"+e)})}}))}}};var he=t(1639),fe=t(9885),me=t(4458),we=t(3190),be=t(7887),ke=t(6611),_e=t(7817),Fe=t(900),ve=t(9800),ye=t(4106),xe=t(5429),Ve=t(9984),Se=t.n(Ve);const ze=(0,he.Z)(pe,[["render",oe]]),Oe=ze;Se()(pe,"components",{QPage:fe.Z,QCard:me.Z,QCardSection:we.Z,QSelect:be.Z,QInput:ke.Z,QTabs:_e.Z,QTab:Fe.Z,QTabPanels:ve.Z,QTabPanel:ye.Z,QOptionGroup:xe.Z})}}]); |