summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2024-05-02 11:39:16 +0200
committerGitHub <noreply@github.com>2024-05-02 11:39:16 +0200
commitd1a31ca22f427970cdb7a2a0d77e2fdb28f33d75 (patch)
tree22a69d3c8fba26c03588cb9266a2a4d5dc2f3f4b
parent1098abd399c459769afdc12322275f85b64b2b65 (diff)
parent73de7a1de5532746ef0f82dcb22b4356e5f98d7a (diff)
Merge pull request #45125 from nextcloud/fix/drop-ical-js
-rw-r--r--dist/dav-settings-personal-availability.js4
-rw-r--r--dist/dav-settings-personal-availability.js.map2
-rw-r--r--package-lock.json1
-rw-r--r--package.json1
-rw-r--r--webpack.common.js6
5 files changed, 3 insertions, 11 deletions
diff --git a/dist/dav-settings-personal-availability.js b/dist/dav-settings-personal-availability.js
index b1bb846618f..968993008b7 100644
--- a/dist/dav-settings-personal-availability.js
+++ b/dist/dav-settings-personal-availability.js
@@ -1,3 +1,3 @@
/*! For license information please see dav-settings-personal-availability.js.LICENSE.txt */
-(()=>{var n,a,e,r={12306:(n,a,e)=>{"use strict";var r=e(85471),s=e(53334),i=e(88837),o=e(9518),d=e(82182),l=e(47732),f=e(43899),c=e(63814),A=e(92457),u=e(26287);function m(t){const n=t.getFullYear(),a=(t.getMonth()+1).toString().padStart(2,"0"),e=t.getDate().toString().padStart(2,"0");return"".concat(n,"-").concat(a,"-").concat(e)}var p=e(38613),T=e(85168),S=e(53529);const h=(0,S.YK)().setApp("dav").detectUser().build(),v={name:"AbsenceForm",components:{NcButton:o.A,NcTextField:d.A,NcTextArea:l.A,NcDateTimePickerNative:f.A},data(){const{firstDay:t,lastDay:n,status:a,message:e}=(0,p.C)("dav","absence",{});return{loading:!1,status:null!=a?a:"",message:null!=e?e:"",firstDay:t?new Date(t):new Date,lastDay:n?new Date(n):null}},computed:{valid(){var t,n;const a=new Date(null===(t=this.firstDay)||void 0===t?void 0:t.getTime()),e=new Date(null===(n=this.lastDay)||void 0===n?void 0:n.getTime());return null==a||a.setHours(0,0,0,0),null==e||e.setHours(0,0,0,0),!!this.firstDay&&!!this.lastDay&&!!this.status&&!!this.message&&e>=a}},methods:{resetForm(){this.status="",this.message="",this.firstDay=new Date,this.lastDay=null},async saveForm(){if(this.valid){this.loading=!0;try{await u.A.post((0,c.KT)("/apps/dav/api/v1/outOfOffice/{userId}",{userId:(0,A.HW)().uid}),{firstDay:m(this.firstDay),lastDay:m(this.lastDay),status:this.status,message:this.message}),(0,T.Te)(this.$t("dav","Absence saved"))}catch(t){(0,T.Qg)(this.$t("dav","Failed to save your absence settings")),h.error("Could not save absence",{error:t})}finally{this.loading=!1}}},async clearAbsence(){this.loading=!0;try{await u.A.delete((0,c.KT)("/apps/dav/api/v1/outOfOffice/{userId}",{userId:(0,A.HW)().uid})),this.resetForm(),(0,T.Te)(this.$t("dav","Absence cleared"))}catch(t){(0,T.Qg)(this.$t("dav","Failed to clear your absence settings")),h.error("Could not clear absence",{error:t})}finally{this.loading=!1}}}};var g=e(85072),y=e.n(g),E=e(97825),C=e.n(E),b=e(77659),x=e.n(b),U=e(55056),_=e.n(U),D=e(10540),k=e.n(D),B=e(41113),w=e.n(B),M=e(55095),W={};W.styleTagTransform=w(),W.setAttributes=_(),W.insert=x().bind(null,"head"),W.domAPI=C(),W.insertStyleElement=k(),y()(M.A,W),M.A&&M.A.locals&&M.A.locals;var P=e(14486);const I=(0,P.A)(v,(function(){var t=this,n=t._self._c;return n("form",{staticClass:"absence",on:{submit:function(n){return n.preventDefault(),t.saveForm.apply(null,arguments)}}},[n("div",{staticClass:"absence__dates"},[n("NcDateTimePickerNative",{staticClass:"absence__dates__picker",attrs:{id:"absence-first-day",label:t.$t("dav","First day"),required:!0},model:{value:t.firstDay,callback:function(n){t.firstDay=n},expression:"firstDay"}}),t._v(" "),n("NcDateTimePickerNative",{staticClass:"absence__dates__picker",attrs:{id:"absence-last-day",label:t.$t("dav","Last day (inclusive)"),required:!0},model:{value:t.lastDay,callback:function(n){t.lastDay=n},expression:"lastDay"}})],1),t._v(" "),n("NcTextField",{attrs:{value:t.status,label:t.$t("dav","Short absence status"),required:!0},on:{"update:value":function(n){t.status=n}}}),t._v(" "),n("NcTextArea",{attrs:{value:t.message,label:t.$t("dav","Long absence Message"),required:!0},on:{"update:value":function(n){t.message=n}}}),t._v(" "),n("div",{staticClass:"absence__buttons"},[n("NcButton",{attrs:{disabled:t.loading||!t.valid,type:"primary","native-type":"submit"}},[t._v("\n\t\t\t"+t._s(t.$t("dav","Save"))+"\n\t\t")]),t._v(" "),n("NcButton",{attrs:{disabled:t.loading||!t.valid,type:"error"},on:{click:t.clearAbsence}},[t._v("\n\t\t\t"+t._s(t.$t("dav","Disable absence"))+"\n\t\t")])],1)],1)}),[],!1,null,"716172ba",null).exports;var N=e(50506),R={};R.styleTagTransform=w(),R.setAttributes=_(),R.insert=x().bind(null,"head"),R.domAPI=C(),R.insertStyleElement=k(),y()(N.A,R),N.A&&N.A.locals&&N.A.locals;var O=e(11037),F=e(27577),G=e(68828),j=e(76225),z=e(18562),K=e(76225);function L(t,n,a,e,r,s,i,o){var d,l="function"==typeof t?t.options:t;if(n&&(l.render=n,l.staticRenderFns=a,l._compiled=!0),e&&(l.functional=!0),s&&(l._scopeId="data-v-"+s),i?(d=function(t){!(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)&&typeof __VUE_SSR_CONTEXT__<"u"&&(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},l._ssrRegister=d):r&&(d=o?function(){r.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:r),d)if(l.functional){l._injectStyles=d;var f=l.render;l.render=function(t,n){return d.call(n),f(t,n)}}else{var c=l.beforeCreate;l.beforeCreate=c?[].concat(c,d):[d]}return{exports:t,options:l}}const $=L({name:"CalendarAvailability",components:{NcDateTimePickerNative:f.A,NcButton:o.A,IconAdd:F.A,IconDelete:O.A},props:{slots:{type:Object,required:!0},loading:{type:Boolean,default:!1},l10nTo:{type:String,required:!0},l10nDeleteSlot:{type:String,required:!0},l10nEmptyDay:{type:String,required:!0},l10nAddSlot:{type:String,required:!0},l10nWeekDayListLabel:{type:String,default:"Weekdays"},l10nMonday:{type:String,required:!0},l10nTuesday:{type:String,required:!0},l10nWednesday:{type:String,required:!0},l10nThursday:{type:String,required:!0},l10nFriday:{type:String,required:!0},l10nSaturday:{type:String,required:!0},l10nSunday:{type:String,required:!0},l10nStartPickerLabel:{type:Function,default:t=>"Pick a start time for ".concat(t)},l10nEndPickerLabel:{type:Function,default:t=>"Pick a end time for ".concat(t)}},data(){return{internalSlots:this.slotsToInternalData(this.slots)}},watch:{slots(){this.internalSlots=this.slotsToInternalData(this.slots)}},methods:{timeStampSlotsToDateObjectSlots:t=>t.map((t=>({start:new Date(1e3*t.start),end:new Date(1e3*t.end)}))),slotsToInternalData(){const t=[{id:"MO",displayName:this.l10nMonday,slots:this.timeStampSlotsToDateObjectSlots(this.slots.MO)},{id:"TU",displayName:this.l10nTuesday,slots:this.timeStampSlotsToDateObjectSlots(this.slots.TU)},{id:"WE",displayName:this.l10nWednesday,slots:this.timeStampSlotsToDateObjectSlots(this.slots.WE)},{id:"TH",displayName:this.l10nThursday,slots:this.timeStampSlotsToDateObjectSlots(this.slots.TH)},{id:"FR",displayName:this.l10nFriday,slots:this.timeStampSlotsToDateObjectSlots(this.slots.FR)},{id:"SA",displayName:this.l10nSaturday,slots:this.timeStampSlotsToDateObjectSlots(this.slots.SA)}],n={id:"SU",displayName:this.l10nSunday,slots:this.timeStampSlotsToDateObjectSlots(this.slots.SU)};return 1===(0,s.JN)()?[...t,n]:[n,...t]},internalDataToSlots(){const t={};return this.internalSlots.forEach((({id:n,slots:a})=>{t[n]=a.map((t=>({start:Math.round(t.start.getTime()/1e3),end:Math.round(t.end.getTime()/1e3)})))})),t},addSlot(t){const n=new Date;n.setHours(9,0,0,0);const a=new Date;a.setHours(17,0,0,0),t.slots.push({start:n,end:a}),this.onChangeSlots()},removeSlot(t,n){t.slots.splice(n,1),this.onChangeSlots()},onChangeSlots(){this.$emit("update:slots",this.internalDataToSlots())}}},(function(){var t=this,n=t._self._c;return n("ul",{staticClass:"week-day-container",attrs:{"aria-label":t.l10nWeekDayListLabel}},[t._l(t.internalSlots,(function(a){return[n("li",{key:"day-label-".concat(a.id),staticClass:"day-container"},[n("div",{staticClass:"label-weekday"},[n("span",{attrs:{id:a.displayName+"-label"}},[t._v(t._s(a.displayName))])]),n("div",{key:"day-slots-".concat(a.id),staticClass:"availability-slots"},[n("div",{staticClass:"availability-slot-group"},[t._l(a.slots,(function(e,r){var s,i;return[n("div",{key:"slot-".concat(a.id,"-").concat(r),staticClass:"availability-slot"},[n("NcDateTimePickerNative",{staticClass:"start-date",attrs:{id:"start-".concat(a.id,"-").concat(r),type:"time",label:null==(s=t.l10nStartPickerLabel)?void 0:s.call(t,a.displayName),"hide-label":!0},on:{change:t.onChangeSlots},model:{value:e.start,callback:function(n){t.$set(e,"start",n)},expression:"slot.start"}}),n("span",{staticClass:"to-text"},[t._v(" "+t._s(t.l10nTo)+" ")]),n("NcDateTimePickerNative",{staticClass:"end-date",attrs:{id:"end-".concat(a.id,"-").concat(r),type:"time",label:null==(i=t.l10nEndPickerLabel)?void 0:i.call(t,a.displayName),"hide-label":!0},on:{change:t.onChangeSlots},model:{value:e.end,callback:function(n){t.$set(e,"end",n)},expression:"slot.end"}}),n("NcButton",{key:"slot-".concat(a.id,"-").concat(r,"-btn"),staticClass:"button",attrs:{type:"tertiary","aria-label":t.l10nDeleteSlot,title:t.l10nDeleteSlot},on: