Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 3 additions & 2 deletions cypress/e2e/sidebar.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { createFolder, getFileListRow, moveFile, navigateToFolder, renameFile } from './filesUtils.ts'
import { addComment, addTag, createPublicShare, randHash, showActivityTab, toggleFavorite } from './sidebarUtils.ts'

describe.skip('Check activity listing in the sidebar', { testIsolation: true }, () => {
describe('Check activity listing in the sidebar', { testIsolation: true }, () => {
beforeEach(function() {
cy.createRandomUser()
.then((user) => {
Expand Down Expand Up @@ -70,7 +70,8 @@ describe.skip('Check activity listing in the sidebar', { testIsolation: true },
cy.get('.activity-entry').first().should('contains.text', 'Added system tag')
})

it('Has comment activity', () => {
// TODO: re-enable when comments app is fixed
it.skip('Has comment activity', () => {
addComment('welcome.txt', 'A comment')
cy.visit('/apps/files')

Expand Down
60 changes: 37 additions & 23 deletions cypress/e2e/sidebarUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,25 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

import { toggleMenuAction } from './filesUtils'
import { toggleMenuAction, triggerActionForFile } from './filesUtils.ts'

function showSidebarForFile(fileName: string) {
closeSidebar()
toggleMenuAction(fileName, 'details')
cy.get('#app-sidebar-vue').should('be.visible')
}

/**
* Close the sidebar
*/
export function closeSidebar() {
cy.get('body')
.then(($body) => {
if ($body.find('.app-sidebar__close').length !== 0) {
// {force: true} as it might be hidden behind toasts
cy.get('[data-cy-sidebar] .app-sidebar__close').click({ force: true })
}
})
cy.get('#app-sidebar-vue').should('not.exist')
// {force: true} as it might be hidden behind toasts
cy.get('[data-cy-sidebar] .app-sidebar__close')
.click({ force: true })
cy.get('[data-cy-sidebar]')
.should('not.be.visible')
cy.wait(500)
cy.url()
.should('not.contain', 'opendetails')
}

export function showActivityTab(fileName: string) {
Expand Down Expand Up @@ -75,24 +77,36 @@ export function createPublicShare(fileName: string) {
cy.wait('@createPublicShare')
}

export function addTag(fileName: string, tag: string) {
showSidebarForFile(fileName)
/**
* Add a system tag to a file
*
* @param fileName - The filename to asign the tag
* @param newTag - The new tag
*/
export function addTag(fileName: string, newTag: string) {
triggerActionForFile(fileName, 'systemtags:bulk')

cy.get('#app-sidebar-vue .app-sidebar-header')
.should('be.visible')
.findByRole('button', { name: 'Actions' })
.click()
cy.intercept('POST', '/remote.php/dav/systemtags').as('createTag')
cy.intercept('PROPFIND', '/remote.php/dav/systemtags/*/files').as('getTagData')
cy.intercept('PROPPATCH', '/remote.php/dav/systemtags/*/files').as('assignTagData')

cy.findByRole('menuitem', { name: 'Tags' })
.should('be.visible')
.click()
cy.get('[data-cy-systemtags-picker-input]').type(newTag)

cy.get('[data-cy-systemtags-picker-tag]').should('have.length', 0)
cy.get('[data-cy-systemtags-picker-button-create]').should('be.visible')
cy.get('[data-cy-systemtags-picker-button-create]').click()

cy.intercept('POST', '/remote.php/dav/systemtags').as('tag')
cy.wait('@createTag')
// Verify the new tag is selected by default
cy.get('[data-cy-systemtags-picker-tag]').contains(newTag)
.parents('[data-cy-systemtags-picker-tag]')
.findByRole('checkbox', { hidden: true }).should('be.checked')

cy.findByLabelText('Search or create collaborative tags')
.type(`${tag}{enter}{esc}`)
// Apply changes
cy.get('[data-cy-systemtags-picker-button-submit]').click()

cy.wait('@tag')
cy.wait('@assignTagData')
cy.get('[data-cy-systemtags-picker]').should('not.exist')
}

export function addComment(fileName: string, comment: string) {
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

3 changes: 3 additions & 0 deletions js/ActivityTab-6Gq3gTQ6.chunk.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-b6867024]{display:flex;flex-direction:column;overflow:hidden;height:100%}.activity__actions[data-v-b6867024]{display:flex;flex-direction:column;width:100%}.activity__list[data-v-b6867024]{flex-grow:1;overflow:scroll}.activity__empty-content[data-v-b6867024]{height:100%}[data-v-b6867024] .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)}})();
import{l as k}from"./activity-sidebar.mjs";import{h as P,e as N,g as j,d as I}from"./_plugin-vue_export-helper-DiB0wW6k.chunk.mjs";import{d as _,r as x,x as B,B as C,y as E,a as s,b as i,L as m,l as L,m as o,e as r,i as p,h as y,F as g,E as R,M as h,n as q}from"./index-6AAKmhoX.chunk.mjs";import{N as G,e as O,_ as V,A as T}from"./ActivityComponent.vue_vue_type_script_setup_true_lang-BPBYWpOt.chunk.mjs";import{g as W,a as F,b as M}from"./api-mFrM-9qG.chunk.mjs";import{l as f}from"./logger-1JHA8kGV.chunk.mjs";import"./preload-helper-DxYC2qmj.chunk.mjs";import"./index-NjYp13Ld.chunk.mjs";const U=_({__name:"ActivitySidebarPlugin",props:{plugin:{},node:{}},emits:["reload-activities"],setup(t,{emit:e}){const a=t,n=e,l=x();return B(()=>a.plugin.mount(l.value,{node:a.node,context:C()?.proxy??void 0,reload:()=>n("reload-activities")})),E(()=>a.plugin.unmount()),(b,d)=>(i(),s("div",{ref_key:"attachTarget",ref:l},null,512))}}),$=_({name:"ActivityTab",components:{ActivityComponent:V,NcEmptyContent:O,NcIconSvgWrapper:G,NcLoadingIcon:P,ActivitySidebarPlugin:U},props:{node:{type:Object,required:!0},folder:{type:Object,required:!1,default:void 0},view:{type:Object,required:!1,default:void 0}},expose:["update"],data(){return{error:"",loading:!0,activities:[],lightningBoltSVG:k,sidebarPlugins:[]}},watch:{node:{immediate:!0,async handler(){await this.update()}}},async mounted(){this.node&&await this.update()},methods:{async update(){this.sidebarPlugins=[];const t=M();t.length>0&&L(()=>{this.sidebarPlugins=t}),this.resetState(),await this.getActivities()},async getActivities(){try{this.loading=!0;const t=await this.processActivities(await this.loadRealActivities()),e=await F({node:this.node});this.activities=[...t,...e].sort((a,n)=>n.timestamp-a.timestamp)}catch(t){this.error=m("activity","Unable to load the activity list"),f.error("Error loading the activity list",{error:t})}finally{this.loading=!1}},resetState(){this.loading=!0,this.error="",this.activities=[]},async loadRealActivities(){try{const{data:t}=await N.get(j("apps/activity/api/v2/activity/filter"),{params:{format:"json",object_type:"files",object_id:this.node.fileid}});return t.ocs.data}catch(t){if(t.response!==void 0&&t.response.status===304)return[];throw t}},processActivities(t){t=t.map(a=>new T(a)),f.debug(`Processed ${t.length} activity(ies)`,{activities:t,node:this.node});const e=W();return t.filter(a=>!e||e.every(n=>n(a)))},t:m}}),z={key:0,class:"activity__actions"},D={key:3,class:"activity__list"};function H(t,e,a,n,l,b){const d=o("NcIconSvgWrapper"),v=o("NcEmptyContent"),A=o("ActivitySidebarPlugin"),w=o("NcLoadingIcon"),S=o("ActivityComponent");return i(),s("div",{class:q([{"icon-loading":t.loading},"activity"])},[t.error||!t.node?(i(),r(v,{key:0,name:t.error},{icon:p(()=>[y(d,{svg:t.lightningBoltSVG},null,8,["svg"])]),_:1},8,["name"])):(i(),s(g,{key:1},[t.sidebarPlugins.length>0?(i(),s("div",z,[(i(!0),s(g,null,h(t.sidebarPlugins,(c,u)=>(i(),r(A,{key:u,plugin:c,node:t.node,onReloadActivities:e[0]||(e[0]=J=>t.getActivities())},null,8,["plugin","node"]))),128))])):R("",!0),t.loading?(i(),r(v,{key:1,class:"activity__empty-content",name:t.t("activity","Loading activities")},{icon:p(()=>[y(w)]),_:1},8,["name"])):t.activities.length===0?(i(),r(v,{key:2,class:"activity__empty-content",name:t.t("activity","No activity yet")},{icon:p(()=>[y(d,{svg:t.lightningBoltSVG},null,8,["svg"])]),_:1},8,["name"])):(i(),s("ul",D,[(i(!0),s(g,null,h(t.activities,c=>(i(),r(S,{key:c.id,activity:c,"show-previews":!1,onReload:e[1]||(e[1]=u=>t.getActivities())},null,8,["activity"]))),128))]))],64))],2)}const at=I($,[["render",H],["__scopeId","data-v-b6867024"]]);export{at as default};
//# sourceMappingURL=ActivityTab-6Gq3gTQ6.chunk.mjs.map
1 change: 1 addition & 0 deletions js/ActivityTab-6Gq3gTQ6.chunk.mjs.map

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

Loading
Loading