From e271e481bfd14804f23bbb83d0e9fd8072f33e77 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 12:44:47 +0000 Subject: [PATCH 1/5] Bump django-tinymce from 3.5.0 to 4.1.0 Bumps [django-tinymce](https://github.com/jazzband/django-tinymce) from 3.5.0 to 4.1.0. - [Release notes](https://github.com/jazzband/django-tinymce/releases) - [Changelog](https://github.com/jazzband/django-tinymce/blob/master/CHANGELOG.rst) - [Commits](https://github.com/jazzband/django-tinymce/compare/3.5.0...4.1.0) --- updated-dependencies: - dependency-name: django-tinymce dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5d079111c1..0dbe76acdb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -158,7 +158,7 @@ django-modeltranslation==0.18.11 # via mapentity django-mptt==0.14.0 # via geotrek (setup.py) -django-tinymce==3.5.0 +django-tinymce==4.1.0 # via mapentity django-treebeard==4.7.1 # via geotrek (setup.py) From e783fcf63bc4a75a6c477303677e724e4d47b609 Mon Sep 17 00:00:00 2001 From: Jean-Etienne Castagnede Date: Tue, 26 Nov 2024 12:56:47 +0000 Subject: [PATCH 2/5] fix deps --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 0dbe76acdb..e68fd3d634 100644 --- a/requirements.txt +++ b/requirements.txt @@ -114,6 +114,7 @@ django==4.2.16 # django-leaflet # django-modelcluster # django-modeltranslation + # django-tinymce # django-treebeard # django-weasyprint # djangorestframework From 1a84dc78ecd03127b83fad2fde0c2fda4f80e0ee Mon Sep 17 00:00:00 2001 From: J-E Castagnede Date: Fri, 29 Nov 2024 15:06:38 +0100 Subject: [PATCH 3/5] use specific command to handle tinyMCE in e2e tests --- cypress/package-lock.json | 13 +------------ cypress/package.json | 1 - cypress/support/commands.js | 15 ++++++++++++++- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/cypress/package-lock.json b/cypress/package-lock.json index c65edd1d41..03089c62be 100644 --- a/cypress/package-lock.json +++ b/cypress/package-lock.json @@ -1,11 +1,10 @@ { - "name": "Geotrek-admin", + "name": "cypress", "lockfileVersion": 2, "requires": true, "packages": { "": { "dependencies": { - "@foreachbe/cypress-tinymce": "^1.0.0", "cypress": "^9.5.1" } }, @@ -54,11 +53,6 @@ "ms": "^2.1.1" } }, - "node_modules/@foreachbe/cypress-tinymce": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@foreachbe/cypress-tinymce/-/cypress-tinymce-1.0.0.tgz", - "integrity": "sha512-/uiJBAPtSp1gYdSd6SAOZ91EGk23458eL93R5tQFwsgmARy3KSHFzQQuJwCH1RFwLWZ/M2wc9a9knRA7httlKA==" - }, "node_modules/@types/node": { "version": "14.18.12", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.12.tgz", @@ -1822,11 +1816,6 @@ } } }, - "@foreachbe/cypress-tinymce": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@foreachbe/cypress-tinymce/-/cypress-tinymce-1.0.0.tgz", - "integrity": "sha512-/uiJBAPtSp1gYdSd6SAOZ91EGk23458eL93R5tQFwsgmARy3KSHFzQQuJwCH1RFwLWZ/M2wc9a9knRA7httlKA==" - }, "@types/node": { "version": "14.18.12", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.12.tgz", diff --git a/cypress/package.json b/cypress/package.json index 3e4ab401d2..47c40ca88d 100644 --- a/cypress/package.json +++ b/cypress/package.json @@ -1,6 +1,5 @@ { "dependencies": { - "@foreachbe/cypress-tinymce": "^1.0.0", "cypress": "^9.5.1" } } diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 7a3b3e8b20..b4c481aa4d 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -21,4 +21,17 @@ Cypress.Commands.add('loginByCSRF', (username, password) => { Cypress.Commands.add('mockTiles', (username, password) => { cy.intercept("https://*.tile.opentopomap.org/*/*/*.png", {fixture: "images/tile.png"}).as("tiles"); -}); \ No newline at end of file +}); + +Cypress.Commands.add('setTinyMceContent', (tinyMceId, content) => { + cy.window().then((win) => { + const editor = win.tinymce.get(tinyMceId); + editor.setContent(content); + }); +}); + +Cypress.Commands.add('getTinyMceContent', (tinyMceId, content) => { + cy.window().then((win) => { + const editor = win.tinymce.get(tinyMceId); + return editor.getContent(); + }); \ No newline at end of file From 4cf508b46b4ff3bc0a34bcc5d3ab44700af29cfa Mon Sep 17 00:00:00 2001 From: J-E Castagnede Date: Fri, 29 Nov 2024 15:17:18 +0100 Subject: [PATCH 4/5] fix command cypress --- cypress/support/commands.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cypress/support/commands.js b/cypress/support/commands.js index b4c481aa4d..9b6e5e749d 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -34,4 +34,5 @@ Cypress.Commands.add('getTinyMceContent', (tinyMceId, content) => { cy.window().then((win) => { const editor = win.tinymce.get(tinyMceId); return editor.getContent(); - }); \ No newline at end of file + }); +}); \ No newline at end of file From f72bfa0fe6b9da60cd8fdd5facee15f4a2965712 Mon Sep 17 00:00:00 2001 From: J-E Castagnede Date: Fri, 29 Nov 2024 15:28:18 +0100 Subject: [PATCH 5/5] fix command cypress --- cypress/support/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cypress/support/index.js b/cypress/support/index.js index 767b6718c4..63268c1f34 100644 --- a/cypress/support/index.js +++ b/cypress/support/index.js @@ -17,5 +17,4 @@ import './commands' // Alternatively you can use CommonJS syntax: -// require('./commands') -import '@foreachbe/cypress-tinymce' \ No newline at end of file +// require('./commands') \ No newline at end of file