@eeacms/volto-tableau 8.0.2 → 8.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -3
- package/Jenkinsfile +1 -1
- package/cypress/e2e/block-basics.cy.js +9 -5
- package/cypress/e2e/block-tableau.cy.js +2 -2
- package/cypress/support/commands.js +14 -10
- package/cypress/support/e2e.js +12 -8
- package/package.json +1 -1
- package/src/Widgets/VisualizationWidget.jsx +4 -3
- package/src/less/tableau.variables +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,11 +4,20 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
-
### [8.0.
|
|
7
|
+
### [8.0.4](https://github.com/eea/volto-tableau/compare/8.0.3...8.0.4) - 22 July 2024
|
|
8
8
|
|
|
9
|
-
#### :
|
|
9
|
+
#### :hammer_and_wrench: Others
|
|
10
|
+
|
|
11
|
+
- Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`22eeee9`](https://github.com/eea/volto-tableau/commit/22eeee93cfa8516261bb037a4bffef654af7a179)]
|
|
12
|
+
- Revert "Add fullwidth property" [Miu Razvan - [`ea36e3c`](https://github.com/eea/volto-tableau/commit/ea36e3c4be0ff20999a5ea7ced69cc77f287ced5)]
|
|
13
|
+
- Add fullwidth property [Miu Razvan - [`8d21ed0`](https://github.com/eea/volto-tableau/commit/8d21ed0b219f94d18998155a77acf2a0c50c9338)]
|
|
14
|
+
### [8.0.3](https://github.com/eea/volto-tableau/compare/8.0.2...8.0.3) - 14 June 2024
|
|
10
15
|
|
|
11
|
-
|
|
16
|
+
#### :hammer_and_wrench: Others
|
|
17
|
+
|
|
18
|
+
- test: Fix eslint [alin - [`37e6137`](https://github.com/eea/volto-tableau/commit/37e613703363336d5ce73b0ebfcb43c200451122)]
|
|
19
|
+
- Don't use the content if in add form [Miu Razvan - [`f37a78f`](https://github.com/eea/volto-tableau/commit/f37a78f459ed954e06c978e93e7bf1bf2590eff7)]
|
|
20
|
+
### [8.0.2](https://github.com/eea/volto-tableau/compare/8.0.1...8.0.2) - 13 May 2024
|
|
12
21
|
|
|
13
22
|
### [8.0.1](https://github.com/eea/volto-tableau/compare/8.0.0...8.0.1) - 8 May 2024
|
|
14
23
|
|
package/Jenkinsfile
CHANGED
|
@@ -9,7 +9,7 @@ pipeline {
|
|
|
9
9
|
environment {
|
|
10
10
|
GIT_NAME = "volto-tableau"
|
|
11
11
|
NAMESPACE = "@eeacms"
|
|
12
|
-
SONARQUBE_TAGS = "volto.eea.europa.eu,climate-energy.eea.europa.eu,forest.eea.europa.eu,biodiversity.europa.eu,water.europa.eu-freshwater,water.europa.eu-marine,industry.eea.europa.eu,demo-www.eea.europa.eu,www.eea.europa.eu-en"
|
|
12
|
+
SONARQUBE_TAGS = "volto.eea.europa.eu,climate-energy.eea.europa.eu,forest.eea.europa.eu,biodiversity.europa.eu,water.europa.eu-freshwater,water.europa.eu-marine,industry.eea.europa.eu,demo-www.eea.europa.eu,www.eea.europa.eu-en,insitu.copernicus.eu"
|
|
13
13
|
DEPENDENCIES = ""
|
|
14
14
|
BACKEND_PROFILES = "eea.kitkat:testing"
|
|
15
15
|
BACKEND_ADDONS = ""
|
|
@@ -11,15 +11,19 @@ describe('Blocks Tests', () => {
|
|
|
11
11
|
|
|
12
12
|
cy.get('.documentFirstHeading').contains('My Add-on Page');
|
|
13
13
|
|
|
14
|
-
cy.getSlate().click();
|
|
14
|
+
cy.getSlate().click({ force: true });
|
|
15
15
|
|
|
16
16
|
// Add block
|
|
17
|
-
cy.get('.ui.basic.icon.button.block-add-button')
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
cy.get('.ui.basic.icon.button.block-add-button')
|
|
18
|
+
.first()
|
|
19
|
+
.click({ force: true });
|
|
20
|
+
cy.get('.blocks-chooser .title').contains('Media').click({ force: true });
|
|
21
|
+
cy.get('.content.active.media .button.image')
|
|
22
|
+
.contains('Image')
|
|
23
|
+
.click({ force: true });
|
|
20
24
|
|
|
21
25
|
// Save
|
|
22
|
-
cy.get('#toolbar-save').click();
|
|
26
|
+
cy.get('#toolbar-save').click({ force: true });
|
|
23
27
|
cy.url().should('eq', Cypress.config().baseUrl + '/cypress/my-page');
|
|
24
28
|
|
|
25
29
|
// then the page view should contain our changes
|
|
@@ -32,8 +32,8 @@ describe('Blocks Tests', () => {
|
|
|
32
32
|
|
|
33
33
|
cy.get(
|
|
34
34
|
`.sidebar-container .field-wrapper-tableau_vis_url #field-tableau_vis_url`,
|
|
35
|
-
).type('/path/to/dashboard');
|
|
36
|
-
cy.get('#toolbar-save').click();
|
|
35
|
+
).type('/path/to/dashboard', { force: true });
|
|
36
|
+
cy.get('#toolbar-save').click({ force: true });
|
|
37
37
|
cy.wait('@content');
|
|
38
38
|
cy.url().should('eq', Cypress.config().baseUrl + '/cypress/my-page');
|
|
39
39
|
});
|
|
@@ -387,7 +387,9 @@ Cypress.Commands.add('getSlate', ({ createNewSlate = true } = {}) => {
|
|
|
387
387
|
},
|
|
388
388
|
() => {
|
|
389
389
|
if (createNewSlate) {
|
|
390
|
-
cy.get('.block.inner')
|
|
390
|
+
cy.get('.block.inner')
|
|
391
|
+
.last()
|
|
392
|
+
.type('{moveToEnd}{enter}', { force: true });
|
|
391
393
|
}
|
|
392
394
|
slate = cy.get(SLATE_SELECTOR, { timeout: 10000 }).last();
|
|
393
395
|
},
|
|
@@ -399,11 +401,11 @@ Cypress.Commands.add('clearSlate', (selector) => {
|
|
|
399
401
|
return cy
|
|
400
402
|
.get(selector)
|
|
401
403
|
.focus()
|
|
402
|
-
.click()
|
|
404
|
+
.click({ force: true })
|
|
403
405
|
.wait(1000)
|
|
404
|
-
.type('{selectAll}')
|
|
406
|
+
.type('{selectAll}', { force: true })
|
|
405
407
|
.wait(1000)
|
|
406
|
-
.type('{backspace}');
|
|
408
|
+
.type('{backspace}', { force: true });
|
|
407
409
|
});
|
|
408
410
|
|
|
409
411
|
Cypress.Commands.add('getSlateTitle', () => {
|
|
@@ -419,19 +421,19 @@ Cypress.Commands.add('clearSlateTitle', () => {
|
|
|
419
421
|
Cypress.Commands.add('setSlateSelection', (subject, query, endQuery) => {
|
|
420
422
|
cy.get('.slate-editor.selected [contenteditable=true]')
|
|
421
423
|
.focus()
|
|
422
|
-
.click()
|
|
424
|
+
.click({ force: true })
|
|
423
425
|
.setSelection(subject, query, endQuery)
|
|
424
426
|
.wait(1000); // this wait is needed for the selection change to be detected after
|
|
425
427
|
});
|
|
426
428
|
|
|
427
429
|
Cypress.Commands.add('getSlateEditorAndType', (type) => {
|
|
428
|
-
cy.getSlate().focus().click().type(type);
|
|
430
|
+
cy.getSlate().focus().click({ force: true }).type(type, { force: true });
|
|
429
431
|
});
|
|
430
432
|
|
|
431
433
|
Cypress.Commands.add('setSlateCursor', (subject, query, endQuery) => {
|
|
432
434
|
cy.get('.slate-editor.selected [contenteditable=true]')
|
|
433
435
|
.focus()
|
|
434
|
-
.click()
|
|
436
|
+
.click({ force: true })
|
|
435
437
|
.setCursor(subject, query, endQuery)
|
|
436
438
|
.wait(1000);
|
|
437
439
|
});
|
|
@@ -446,7 +448,7 @@ Cypress.Commands.add('toolbarSave', () => {
|
|
|
446
448
|
cy.wait(1000);
|
|
447
449
|
|
|
448
450
|
// Save
|
|
449
|
-
cy.get('#toolbar-save').click();
|
|
451
|
+
cy.get('#toolbar-save').click({ force: true });
|
|
450
452
|
cy.waitForResourceToLoad('@navigation');
|
|
451
453
|
cy.waitForResourceToLoad('@breadcrumbs');
|
|
452
454
|
cy.waitForResourceToLoad('@actions');
|
|
@@ -537,14 +539,16 @@ Cypress.Commands.add(
|
|
|
537
539
|
|
|
538
540
|
Cypress.Commands.add('addNewBlock', (blockName, createNewSlate = false) => {
|
|
539
541
|
let block;
|
|
540
|
-
block = cy
|
|
542
|
+
block = cy
|
|
543
|
+
.getSlate(createNewSlate)
|
|
544
|
+
.type(`/${blockName}{enter}`, { force: true });
|
|
541
545
|
return block;
|
|
542
546
|
});
|
|
543
547
|
|
|
544
548
|
Cypress.Commands.add('getSlate', (createNewSlate = false) => {
|
|
545
549
|
let slate;
|
|
546
550
|
if (createNewSlate) {
|
|
547
|
-
cy.get('.block.inner').last().type('{moveToEnd}{enter}');
|
|
551
|
+
cy.get('.block.inner').last().type('{moveToEnd}{enter}', { force: true });
|
|
548
552
|
}
|
|
549
553
|
cy.getIfExists(
|
|
550
554
|
SLATE_SELECTOR,
|
package/cypress/support/e2e.js
CHANGED
|
@@ -58,13 +58,17 @@ export const slateJsonAfterEach = (contentType = 'slate') => {
|
|
|
58
58
|
};
|
|
59
59
|
|
|
60
60
|
export const getSelectedSlateEditor = () => {
|
|
61
|
-
return cy
|
|
61
|
+
return cy
|
|
62
|
+
.get('.slate-editor.selected [contenteditable=true]')
|
|
63
|
+
.click({ force: true });
|
|
62
64
|
};
|
|
63
65
|
|
|
64
66
|
export const createSlateBlock = () => {
|
|
65
|
-
cy.get('.ui.basic.icon.button.block-add-button')
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
cy.get('.ui.basic.icon.button.block-add-button')
|
|
68
|
+
.first()
|
|
69
|
+
.click({ force: true });
|
|
70
|
+
cy.get('.blocks-chooser .title').contains('Text').click({ force: true });
|
|
71
|
+
cy.get('.ui.basic.icon.button.slate').contains('Text').click({ force: true });
|
|
68
72
|
return getSelectedSlateEditor();
|
|
69
73
|
};
|
|
70
74
|
|
|
@@ -92,17 +96,17 @@ export const createSlateBlockWithList = ({
|
|
|
92
96
|
// TODO: do not hardcode these selectors:
|
|
93
97
|
if (numbered) {
|
|
94
98
|
// this is the numbered list option in the hovering toolbar
|
|
95
|
-
cy.get('.slate-inline-toolbar > :nth-child(9)').click();
|
|
99
|
+
cy.get('.slate-inline-toolbar > :nth-child(9)').click({ force: true });
|
|
96
100
|
} else {
|
|
97
101
|
// this is the bulleted list option in the hovering toolbar
|
|
98
|
-
cy.get('.slate-inline-toolbar > :nth-child(10)').click();
|
|
102
|
+
cy.get('.slate-inline-toolbar > :nth-child(10)').click({ force: true });
|
|
99
103
|
}
|
|
100
104
|
|
|
101
105
|
// move the text cursor
|
|
102
106
|
const sse = getSelectedSlateEditor();
|
|
103
|
-
sse.type('{leftarrow}');
|
|
107
|
+
sse.type('{leftarrow}', { force: true });
|
|
104
108
|
for (let i = 0; i < firstItemText.length; ++i) {
|
|
105
|
-
sse.type('{rightarrow}');
|
|
109
|
+
sse.type('{rightarrow}', { force: true });
|
|
106
110
|
}
|
|
107
111
|
|
|
108
112
|
// simulate pressing Enter
|
package/package.json
CHANGED
|
@@ -20,6 +20,7 @@ import '@eeacms/volto-tableau/less/tableau.less';
|
|
|
20
20
|
const VisualizationWidget = (props) => {
|
|
21
21
|
const { location, content } = props;
|
|
22
22
|
const ogValue = props.value || {};
|
|
23
|
+
const inAddForm = props.location.pathname.split('/').pop() === 'add';
|
|
23
24
|
const viz = React.useRef();
|
|
24
25
|
const [schema, setSchema] = React.useState(null);
|
|
25
26
|
const [vizState, setVizState] = React.useState({
|
|
@@ -34,7 +35,7 @@ const VisualizationWidget = (props) => {
|
|
|
34
35
|
getTableauVisualization({
|
|
35
36
|
isBlock: false,
|
|
36
37
|
content: {
|
|
37
|
-
...content,
|
|
38
|
+
...(inAddForm ? {} : content),
|
|
38
39
|
tableau_visualization: value,
|
|
39
40
|
},
|
|
40
41
|
}),
|
|
@@ -76,12 +77,12 @@ const VisualizationWidget = (props) => {
|
|
|
76
77
|
getTableauVisualization({
|
|
77
78
|
isBlock: false,
|
|
78
79
|
content: {
|
|
79
|
-
...content,
|
|
80
|
+
...(inAddForm ? {} : content),
|
|
80
81
|
tableau_visualization: value,
|
|
81
82
|
},
|
|
82
83
|
}),
|
|
83
84
|
);
|
|
84
|
-
}, [content, value]);
|
|
85
|
+
}, [content, value, inAddForm]);
|
|
85
86
|
|
|
86
87
|
/**
|
|
87
88
|
* Update query
|