Skip to content

Commit be1ffea

Browse files
authored
Merge pull request #3083 from nextcloud/renovate/stable33-npm-dompurify-vulnerability
chore(deps): update dependency dompurify to v3.3.2 [security] (stable33) - abandoned
2 parents b264d9e + f8cbc11 commit be1ffea

27 files changed

Lines changed: 420 additions & 149 deletions

cypress/e2e/actions/sidebar.cy.ts

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,12 @@ describe('Open the sidebar from the viewer and open viewer with sidebar already
5555
// open the menu
5656
cy.get('body > .viewer .modal-header button.action-item__menutoggle').click()
5757
// open the sidebar
58-
cy.get('.action-button__icon.icon-menu-sidebar').click()
58+
cy.findByRole('menuitem', { name: 'Open sidebar' }).click()
5959
cy.get('aside.app-sidebar').should('be.visible')
6060
// we hide the sidebar button if opened
6161
cy.get('.action-button__icon.icon-menu-sidebar').should('not.exist')
6262
// check the sidebar is opened for the correct file
6363
cy.get('aside.app-sidebar .app-sidebar-header .app-sidebar-header__mainname').should('contain', 'image1.jpg')
64-
// check we do not have a preview
65-
cy.get('aside.app-sidebar .app-sidebar-header').should('have.class', 'app-sidebar-header--with-figure')
66-
cy.get('aside.app-sidebar .app-sidebar-header').should('have.class', 'app-sidebar-header--compact')
67-
cy.get('aside.app-sidebar .app-sidebar-header .app-sidebar-header__figure').should('have.attr', 'style').should('contain', 'core/filetypes')
68-
})
69-
70-
it('Sidebar is in compact mode', function() {
71-
// check the sidebar is opened for the correct file
72-
cy.get('aside.app-sidebar .app-sidebar-header .app-sidebar-header__mainname').should('contain', 'image1.jpg')
73-
// check we do not have a preview
74-
cy.get('aside.app-sidebar .app-sidebar-header').should('have.class', 'app-sidebar-header--with-figure')
75-
cy.get('aside.app-sidebar .app-sidebar-header').should('have.class', 'app-sidebar-header--compact')
76-
cy.get('aside.app-sidebar .app-sidebar-header .app-sidebar-header__figure').should('have.attr', 'style').should('contain', 'core/filetypes')
7764
})
7865

7966
it('Change to next image with sidebar open', function() {
@@ -100,30 +87,41 @@ describe('Open the sidebar from the viewer and open viewer with sidebar already
10087

10188
it('Close the sidebar', function() {
10289
cy.get('aside.app-sidebar .app-sidebar-header .app-sidebar__close').click()
103-
cy.get('aside.app-sidebar').should('not.exist')
90+
cy.get('aside.app-sidebar').should('not.be.visible')
10491
cy.get('body > .viewer .modal-header button.action-item__menutoggle').should('be.visible')
10592
cy.get('body > .viewer .modal-header button.action-item__menutoggle').click()
10693
// The button to show the sidebar is shown again
107-
cy.get('.action-button__icon.icon-menu-sidebar').should('be.visible')
94+
cy.findByRole('menuitem', { name: 'Open sidebar' }).should('be.visible')
10895
})
10996

11097
it('Open the viewer with the sidebar open', function() {
11198
cy.get('body > .viewer .modal-header button.header-close').click()
11299
cy.get('body > .viewer').should('not.exist')
113100

114101
// open the sidebar without viewer open
115-
cy.getFile('image1.jpg').find('[data-cy-files-list-row-mtime]').click()
102+
cy.getFile('image1.jpg')
103+
.find('[data-cy-files-list-row-mtime]')
104+
.click()
105+
cy.get('aside.app-sidebar').should('be.visible')
106+
cy.url().should('contain', 'opendetails=true')
107+
108+
// eslint-disable-next-line
109+
cy.wait(500)
116110

117111
cy.openFile('image1.jpg')
118112
cy.get('body > .viewer', { timeout: 10000 })
119113
.should('be.visible')
120114
.and('have.class', 'modal-mask')
121115
.and('not.have.class', 'icon-loading')
122-
cy.get('aside.app-sidebar').should('have.class', 'app-sidebar--full')
116+
117+
// eslint-disable-next-line
118+
cy.wait(500)
123119

124120
// close the sidebar again
125-
cy.get('aside.app-sidebar .app-sidebar-header .app-sidebar__close').click()
126-
cy.get('aside.app-sidebar').should('not.exist')
121+
cy.get('aside.app-sidebar')
122+
.findByRole('button', { name: 'Close sidebar' })
123+
.click()
124+
cy.get('aside.app-sidebar').should('not.be.visible')
127125
cy.get('body > .viewer .modal-header button.action-item__menutoggle').should('be.visible')
128126
})
129127
})

cypress/e2e/download-forbidden.cy.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ describe('Disable download button if forbidden', { testIsolation: true }, () =>
4949

5050
it('See the title on the viewer header but not the Download nor the menu button', () => {
5151
cy.getFile('image1.jpg').should('be.visible')
52+
// eslint-disable-next-line
53+
cy.wait(250)
5254
cy.openFile('image1.jpg')
5355
cy.get('body > .viewer .modal-header__name').should('contain', 'image1.jpg')
5456

cypress/e2e/mixins/oddname.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,12 @@ export default function(file, type, sidebar = false) {
113113
// open the menu
114114
cy.get('body > .viewer .modal-header button.action-item__menutoggle').click()
115115
// open the sidebar
116-
cy.get('.action-button__icon.icon-menu-sidebar').click()
116+
cy.findByRole('menuitem', { name: 'Open sidebar' }).should('be.visible').click()
117117
cy.get('aside.app-sidebar').should('be.visible')
118118
// we hide the sidebar button if opened
119119
cy.get('.action-button__icon.icon-menu-sidebar').should('not.exist')
120120
// check the sidebar is opened for the correct file
121121
cy.get('aside.app-sidebar .app-sidebar-header .app-sidebar-header__mainname').should('contain', placedName)
122-
// check we do not have a preview
123-
cy.get('aside.app-sidebar .app-sidebar-header').should('have.class', 'app-sidebar-header--with-figure')
124-
cy.get('aside.app-sidebar .app-sidebar-header').should('have.class', 'app-sidebar-header--compact')
125-
cy.get('aside.app-sidebar .app-sidebar-header .app-sidebar-header__figure').should('have.attr', 'style').should('contain', 'core/filetypes')
126122
})
127123
}
128124

cypress/e2e/sharing/download-share-disabled.cy.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,14 @@ describe(`Download ${fileName} in viewer`, function() {
3434
})
3535

3636
it('Share the Photos folder with a share link, disable download and access the share link', function() {
37-
cy.on('uncaught:exception', (err) => {
38-
// This can happen because of blink engine handling animation, its not a bug just engine related.
39-
if (err.message.includes('ResizeObserver loop limit exceeded')) {
40-
return false
41-
}
42-
})
43-
4437
cy.createLinkShare('/Photos').then((token: string) => {
4538
cy.intercept('GET', '**/apps/files_sharing/api/v1/shares*').as('sharingAPI')
4639

4740
// Open the sidebar from the breadcrumbs
48-
cy.get('[data-cy-files-content-breadcrumbs] .files-list__header-share-button').click()
41+
cy.findByRole('navigation', { name: 'Current directory path' })
42+
.findByRole('button', { name: 'Photos' })
43+
.click()
44+
cy.findByRole('menuitem', { name: 'Share' }).click()
4945
cy.get('aside.app-sidebar').should('be.visible')
5046

5147
// Wait for the sidebar to be done loading
@@ -54,6 +50,8 @@ describe(`Download ${fileName} in viewer`, function() {
5450
// Open the share menu
5551
cy.get('.sharing-link-list > .sharing-entry button[aria-label*="Actions for "]').click()
5652
cy.get('.action-button:contains(\'Customize link\')').click()
53+
cy.findByRole('button', { name: 'Advanced settings' }).click()
54+
5755
cy.get('.checkbox-radio-switch-checkbox').contains('Hide download').as('hideDownloadBtn')
5856
// click the label
5957
cy.get('@hideDownloadBtn').get('span').contains('Hide download').click()

cypress/e2e/sharing/download-share.cy.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ describe(`Download ${fileName} from viewer in link share`, function() {
7171
})
7272

7373
it('See the full screen and download icons in the menu', function() {
74-
cy.get('body > .v-popper__popper ul span.fullscreen-icon').should('be.visible')
75-
cy.get(`body > .v-popper__popper ul a.action-link[href*='/public.php/dav/files/${token}/image1.jpg']`).should('be.visible')
74+
cy.findByRole('menuitem', { name: 'Full screen' }).should('be.visible')
75+
cy.findByRole('menuitem', { name: 'Download' }).should('be.visible')
7676
})
7777

7878
it('Download the image', function() {
7979
// https://github.com/cypress-io/cypress/issues/14857
8080
cy.window().then((win) => { setTimeout(() => { win.location.reload() }, 5000) })
8181
// download the file
82-
cy.get(`body > .v-popper__popper ul a.action-link[href*='/public.php/dav/files/${token}/image1.jpg']`).click()
82+
cy.findByRole('menuitem', { name: 'Download' }).click()
8383
})
8484

8585
it('Compare downloaded file with asset by size', function() {

cypress/support/commands.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ Cypress.Commands.add('getFile', fileName => {
8080
})
8181

8282
Cypress.Commands.add('openFile', fileName => {
83-
cy.getFile(fileName).click()
83+
cy.getFile(fileName)
84+
.find('button')
85+
.first()
86+
.should('be.visible')
87+
.click()
8488
// eslint-disable-next-line
8589
cy.wait(250)
8690
})

cypress/support/e2e.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@
1919

2020
// Import commands.js using ES2015 syntax:
2121
import './commands'
22+
23+
Cypress.on('uncaught:exception', () => {
24+
return false
25+
})
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
import{n as i,ai as s,bi as a,bj as n}from"./previewUtils-mb7vuryY.chunk.mjs";import{A as o}from"./actionText-fFcUPi2g-gjw6zxAU.chunk.mjs";const l={name:"NcActionButton",components:{NcIconSvgWrapper:s},mixins:[o],inject:{isInSemanticMenu:{from:"NcActions:isSemanticMenu",default:!1}},props:{ariaHidden:{type:Boolean,default:null},disabled:{type:Boolean,default:!1},isMenu:{type:Boolean,default:!1},type:{type:String,default:"button",validator:t=>["button","checkbox","radio","reset","submit"].includes(t)},modelValue:{type:[Boolean,String],default:null},value:{type:String,default:null},description:{type:String,default:""}},setup(){return{mdiCheck:n,mdiChevronRight:a}},computed:{isFocusable(){return!this.disabled},isChecked(){return this.type==="radio"&&typeof this.modelValue!="boolean"?this.modelValue===this.value:this.modelValue},nativeType(){return this.type==="submit"||this.type==="reset"?this.type:"button"},buttonAttributes(){const t={};return this.isInSemanticMenu?(t.role="menuitem",this.type==="radio"?(t.role="menuitemradio",t["aria-checked"]=this.isChecked?"true":"false"):(this.type==="checkbox"||this.nativeType==="button"&&this.modelValue!==null)&&(t.role="menuitemcheckbox",t["aria-checked"]=this.modelValue===null?"mixed":this.modelValue?"true":"false")):this.modelValue!==null&&this.nativeType==="button"&&(t["aria-pressed"]=this.modelValue?"true":"false"),t}},methods:{handleClick(t){this.onClick(t),(this.modelValue!==null||this.type!=="button")&&(this.type==="radio"?typeof this.modelValue!="boolean"?this.isChecked||this.$emit("update:modelValue",this.value):this.$emit("update:modelValue",!this.isChecked):this.$emit("update:modelValue",!this.isChecked))}}};var c=function(){var t=this,e=t._self._c;return e("li",{staticClass:"action",class:{"action--disabled":t.disabled},attrs:{role:t.isInSemanticMenu&&"presentation"}},[e("button",t._b({class:["action-button button-vue",{"action-button--active":t.isChecked,focusable:t.isFocusable}],attrs:{"aria-label":t.ariaLabel,disabled:t.disabled,title:t.title,type:t.nativeType},on:{click:t.handleClick}},"button",t.buttonAttributes,!1),[t._t("icon",function(){return[e("span",{staticClass:"action-button__icon",class:[t.isIconUrl?"action-button__icon--url":t.icon],style:{backgroundImage:t.isIconUrl?`url(${t.icon})`:null},attrs:{"aria-hidden":"true"}})]}),e("span",{staticClass:"action-button__longtext-wrapper"},[t.name?e("strong",{staticClass:"action-button__name"},[t._v(" "+t._s(t.name)+" ")]):t._e(),t.isLongText?e("span",{staticClass:"action-button__longtext",domProps:{textContent:t._s(t.text)}}):e("span",{staticClass:"action-button__text"},[t._v(" "+t._s(t.text)+" ")]),t.description?e("span",{staticClass:"action-button__description",domProps:{textContent:t._s(t.description)}}):t._e()]),t.isMenu?e("NcIconSvgWrapper",{staticClass:"action-button__menu-icon",attrs:{directional:"",path:t.mdiChevronRight}}):t.isChecked?e("NcIconSvgWrapper",{staticClass:"action-button__pressed-icon",attrs:{path:t.mdiCheck}}):t.isChecked===!1?e("span",{staticClass:"action-button__pressed-icon material-design-icon"}):t._e(),t._e()],2)])},u=[],r=i(l,c,u,!1,null,"102cfc0a");const h=r.exports;export{h as default};
2-
//# sourceMappingURL=NcActionButton-BfBFARjv.chunk.mjs.map
1+
import{n as i,ai as s,bi as a,bj as n}from"./previewUtils-Cu93PGNf.chunk.mjs";import{A as o}from"./actionText-fFcUPi2g-gjw6zxAU.chunk.mjs";const l={name:"NcActionButton",components:{NcIconSvgWrapper:s},mixins:[o],inject:{isInSemanticMenu:{from:"NcActions:isSemanticMenu",default:!1}},props:{ariaHidden:{type:Boolean,default:null},disabled:{type:Boolean,default:!1},isMenu:{type:Boolean,default:!1},type:{type:String,default:"button",validator:t=>["button","checkbox","radio","reset","submit"].includes(t)},modelValue:{type:[Boolean,String],default:null},value:{type:String,default:null},description:{type:String,default:""}},setup(){return{mdiCheck:n,mdiChevronRight:a}},computed:{isFocusable(){return!this.disabled},isChecked(){return this.type==="radio"&&typeof this.modelValue!="boolean"?this.modelValue===this.value:this.modelValue},nativeType(){return this.type==="submit"||this.type==="reset"?this.type:"button"},buttonAttributes(){const t={};return this.isInSemanticMenu?(t.role="menuitem",this.type==="radio"?(t.role="menuitemradio",t["aria-checked"]=this.isChecked?"true":"false"):(this.type==="checkbox"||this.nativeType==="button"&&this.modelValue!==null)&&(t.role="menuitemcheckbox",t["aria-checked"]=this.modelValue===null?"mixed":this.modelValue?"true":"false")):this.modelValue!==null&&this.nativeType==="button"&&(t["aria-pressed"]=this.modelValue?"true":"false"),t}},methods:{handleClick(t){this.onClick(t),(this.modelValue!==null||this.type!=="button")&&(this.type==="radio"?typeof this.modelValue!="boolean"?this.isChecked||this.$emit("update:modelValue",this.value):this.$emit("update:modelValue",!this.isChecked):this.$emit("update:modelValue",!this.isChecked))}}};var c=function(){var t=this,e=t._self._c;return e("li",{staticClass:"action",class:{"action--disabled":t.disabled},attrs:{role:t.isInSemanticMenu&&"presentation"}},[e("button",t._b({class:["action-button button-vue",{"action-button--active":t.isChecked,focusable:t.isFocusable}],attrs:{"aria-label":t.ariaLabel,disabled:t.disabled,title:t.title,type:t.nativeType},on:{click:t.handleClick}},"button",t.buttonAttributes,!1),[t._t("icon",function(){return[e("span",{staticClass:"action-button__icon",class:[t.isIconUrl?"action-button__icon--url":t.icon],style:{backgroundImage:t.isIconUrl?`url(${t.icon})`:null},attrs:{"aria-hidden":"true"}})]}),e("span",{staticClass:"action-button__longtext-wrapper"},[t.name?e("strong",{staticClass:"action-button__name"},[t._v(" "+t._s(t.name)+" ")]):t._e(),t.isLongText?e("span",{staticClass:"action-button__longtext",domProps:{textContent:t._s(t.text)}}):e("span",{staticClass:"action-button__text"},[t._v(" "+t._s(t.text)+" ")]),t.description?e("span",{staticClass:"action-button__description",domProps:{textContent:t._s(t.description)}}):t._e()]),t.isMenu?e("NcIconSvgWrapper",{staticClass:"action-button__menu-icon",attrs:{directional:"",path:t.mdiChevronRight}}):t.isChecked?e("NcIconSvgWrapper",{staticClass:"action-button__pressed-icon",attrs:{path:t.mdiCheck}}):t.isChecked===!1?e("span",{staticClass:"action-button__pressed-icon material-design-icon"}):t._e(),t._e()],2)])},u=[],r=i(l,c,u,!1,null,"102cfc0a");const h=r.exports;export{h as default};
2+
//# sourceMappingURL=NcActionButton-Bkk2OwJq.chunk.mjs.map
File renamed without changes.

0 commit comments

Comments
 (0)