Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ActivityTab): vertically center empty content #1733

Merged
merged 4 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions js/ActivityTab-Dmh_gT52.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".activity[data-v-b4fa88c7]{display:flex;flex-direction:column;overflow:hidden;height:100%}.activity__actions[data-v-b4fa88c7]{display:flex;flex-direction:column;width:100%}.activity__empty-content[data-v-b4fa88c7]{height:100%}[data-v-b4fa88c7] .empty-content__icon span{background-size:64px;width:64px;height:64px}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
/*! third party licenses: js/vendor.LICENSE.txt */
import{b as r,e as c,f as l,v as u}from"./NcCheckboxRadioSwitch-D2GbHtCS-C8gN2dlh.mjs";import{d as v,r as f,o as p,g as d,f as y,t as o}from"./index-BK2GMarY.mjs";import{a as g,b as m,N as h,c as _}from"./Activity-B8_MJ-Qt.mjs";import{g as b,a as I,b as A}from"./api-D5L3rAZA.mjs";import{l as S}from"./logger-CcLDq3iB.mjs";import{l as N}from"./activity-sidebar.mjs";import"./_commonjsHelpers-BdswosdL.mjs";const w=v({__name:"ActivitySidebarPlugin",props:{plugin:null,fileInfo:null},emits:["reload-activities"],setup(t,{emit:i}){const a=t,s=f();return p(()=>{var n;return a.plugin.mount(s.value,{context:(n=d())==null?void 0:n.proxy,fileInfo:a.fileInfo,reload:()=>i("reload-activities")})}),y(()=>a.plugin.unmount()),{__sfc:!0,props:a,emit:i,attachTarget:s}}});var x=function(){var t=this,i=t._self._c;return t._self._setupProxy,i("div",{ref:"attachTarget"})},P=[],C=r(w,x,P,!1,null,null,null,null);const k=C.exports,E={name:"ActivityTab",components:{Activity:g,NcEmptyContent:m,NcIconSvgWrapper:h,NcLoadingIcon:c,ActivitySidebarPlugin:k},data(){return{error:"",loading:!0,fileInfo:null,activities:[],lightningBoltSVG:N,sidebarPlugins:[]}},mounted(){this.sidebarPlugins=b()},methods:{async update(t){this.fileInfo=t,this.resetState(),await this.getActivities()},async getActivities(){try{this.loading=!0;const t=await this.processActivities(await this.loadRealActivities()),i=await I({fileInfo:this.fileInfo});this.activities=[...t,...i].sort((a,s)=>s.timestamp-a.timestamp)}catch(t){this.error=o("activity","Unable to load the activity list"),console.error("Error loading the activity list",t)}finally{this.loading=!1}},resetState(){this.loading=!0,this.error="",this.activities=[]},async loadRealActivities(){try{const{data:t}=await l.get(u("apps/activity/api/v2/activity/filter"),{params:{format:"json",object_type:"files",object_id:this.fileInfo.id}});return t.ocs.data}catch(t){if(t.response!==void 0&&t.response.status===304)return[];throw e}},processActivities(t){t=t.map(a=>new _(a)),S.debug("Processed ".concat(t.length," activity(ies)"),{activities:t,fileInfo:this.fileInfo});const i=A();return t.filter(a=>!i||i.every(s=>s(a)))},t:o}};var j=function(){var t=this,i=t._self._c;return i("div",{class:{activity:!0,"icon-loading":t.loading}},[t.error?i("NcEmptyContent",{attrs:{name:t.error},scopedSlots:t._u([{key:"icon",fn:function(){return[i("NcIconSvgWrapper",{attrs:{svg:t.lightningBoltSVG}})]},proxy:!0}],null,!1,63559581)}):[t.sidebarPlugins.length>0?i("div",{staticClass:"activity__actions"},t._l(t.sidebarPlugins,function(a,s){return i("ActivitySidebarPlugin",{key:s,attrs:{plugin:a,"file-info":t.fileInfo},on:{"reload-activities":function(n){return t.getActivities()}}})}),1):t._e(),t.loading?i("NcEmptyContent",{staticClass:"activity__empty-content",attrs:{name:t.t("activity","Loading activities")},scopedSlots:t._u([{key:"icon",fn:function(){return[i("NcLoadingIcon")]},proxy:!0}],null,!1,3085876643)}):t.activities.length===0?i("NcEmptyContent",{staticClass:"activity__empty-content",attrs:{name:t.t("activity","No activity yet")},scopedSlots:t._u([{key:"icon",fn:function(){return[i("span",{staticClass:"icon-activity"})]},proxy:!0}])}):i("ul",t._l(t.activities,function(a){return i("Activity",{key:a.id,attrs:{activity:a,"show-previews":!1},on:{reload:function(s){return t.getActivities()}}})}),1)]],2)},L=[],T=r(E,j,L,!1,null,"b4fa88c7",null,null);const U=T.exports;export{U as default};
1 change: 1 addition & 0 deletions js/ActivityTab-Dmh_gT52.mjs.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions js/ActivityTab-baEvP526.mjs

This file was deleted.

Loading
Loading