@eeacms/volto-tableau 3.0.8 → 4.1.0
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 +20 -7
- package/Jenkinsfile +2 -0
- package/jest-addon.config.js +2 -2
- package/package.json +1 -1
- package/src/{TableauBlock → Blocks/EmbedTableauVisualization}/Edit.jsx +7 -7
- package/src/Blocks/EmbedTableauVisualization/View.jsx +66 -0
- package/src/Blocks/EmbedTableauVisualization/index.js +30 -0
- package/src/Blocks/{EmbedEEATableauBlock → EmbedTableauVisualization}/schema.js +32 -13
- package/src/Blocks/TableauBlock/Edit.jsx +41 -0
- package/src/Blocks/TableauBlock/View.jsx +101 -0
- package/src/Blocks/TableauBlock/index.js +30 -0
- package/src/Blocks/TableauBlock/schema.js +224 -0
- package/src/Blocks/index.js +9 -0
- package/src/Tableau/Tableau.jsx +430 -0
- package/src/Tableau/helpers.js +41 -0
- package/src/Utils/Download/Download.jsx +72 -0
- package/src/Utils/JsonCodeSnippet/JsonCodeSnippet.jsx +48 -0
- package/src/Utils/Share/Share.jsx +21 -0
- package/src/Utils/Sources/Sources.jsx +66 -0
- package/src/Views/VisualizationView.jsx +18 -32
- package/src/Widgets/VisualizationWidget.jsx +92 -122
- package/src/Widgets/schema.js +88 -115
- package/src/helpers.js +15 -34
- package/src/hooks.js +18 -0
- package/src/icons/download.svg +5 -0
- package/src/index.js +4 -66
- package/src/less/tableau.less +172 -70
- package/src/less/tableau.variables +7 -13
- package/src/Blocks/EmbedEEATableauBlock/Edit.jsx +0 -56
- package/src/Blocks/EmbedEEATableauBlock/View.jsx +0 -74
- package/src/ConnectedTableau/ConnectedTableau.jsx +0 -29
- package/src/CustomWidgets/UrlParamsWidget.jsx +0 -29
- package/src/DownloadExtras/TableauDownload.jsx +0 -124
- package/src/DownloadExtras/TableauFullscreen.jsx +0 -78
- package/src/DownloadExtras/TableauShare.jsx +0 -81
- package/src/DownloadExtras/style.less +0 -152
- package/src/Sources/Sources.jsx +0 -50
- package/src/Sources/index.js +0 -3
- package/src/Sources/style.css +0 -7
- package/src/Tableau/View.jsx +0 -254
- package/src/TableauBlock/View.jsx +0 -109
- package/src/TableauBlock/schema.js +0 -124
- package/src/Widgets/style.less +0 -8
- package/src/actions.js +0 -9
- package/src/constants.js +0 -1
- package/src/downloadHelpers/downloadHelpers.js +0 -25
- package/src/middleware.js +0 -39
- package/src/store.js +0 -72
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
const urlParametersSchema = {
|
|
2
|
-
title: 'Parameter',
|
|
3
|
-
fieldsets: [
|
|
4
|
-
{ id: 'default', title: 'Default', fields: ['field', 'urlParam'] },
|
|
5
|
-
],
|
|
6
|
-
properties: {
|
|
7
|
-
field: {
|
|
8
|
-
title: 'Tableau fieldname',
|
|
9
|
-
type: 'text',
|
|
10
|
-
},
|
|
11
|
-
urlParam: {
|
|
12
|
-
title: 'URL param',
|
|
13
|
-
type: 'text',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
required: [],
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const breakpointUrlSchema = (config) => {
|
|
20
|
-
const breakpoints = config.blocks.blocksConfig.tableau_block.breakpoints;
|
|
21
|
-
|
|
22
|
-
return {
|
|
23
|
-
title: 'URL',
|
|
24
|
-
fieldsets: [{ id: 'default', title: 'Default', fields: ['device', 'url'] }],
|
|
25
|
-
properties: {
|
|
26
|
-
device: {
|
|
27
|
-
title: 'Device',
|
|
28
|
-
type: 'array',
|
|
29
|
-
choices: Object.keys(breakpoints).map((breakpoint) => [
|
|
30
|
-
breakpoint,
|
|
31
|
-
breakpoint,
|
|
32
|
-
]),
|
|
33
|
-
},
|
|
34
|
-
url: {
|
|
35
|
-
title: 'Url',
|
|
36
|
-
widget: 'textarea',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
required: [],
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export default (config) => ({
|
|
44
|
-
title: 'Tableau',
|
|
45
|
-
fieldsets: [
|
|
46
|
-
{
|
|
47
|
-
id: 'default',
|
|
48
|
-
title: 'Default',
|
|
49
|
-
fields: ['url', 'title', 'description'],
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
id: 'options',
|
|
53
|
-
title: 'Options',
|
|
54
|
-
fields: [
|
|
55
|
-
'sheetname',
|
|
56
|
-
'hideTabs',
|
|
57
|
-
'hideToolbar',
|
|
58
|
-
'autoScale',
|
|
59
|
-
'toolbarPosition',
|
|
60
|
-
],
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
id: 'extra_options',
|
|
64
|
-
title: 'Extra options',
|
|
65
|
-
fields: ['urlParameters', 'breakpointUrls'],
|
|
66
|
-
},
|
|
67
|
-
],
|
|
68
|
-
properties: {
|
|
69
|
-
url: {
|
|
70
|
-
title: 'Url',
|
|
71
|
-
widget: 'textarea',
|
|
72
|
-
},
|
|
73
|
-
title: {
|
|
74
|
-
title: 'Title',
|
|
75
|
-
widget: 'textarea',
|
|
76
|
-
},
|
|
77
|
-
description: {
|
|
78
|
-
title: 'Description',
|
|
79
|
-
widget: 'textarea',
|
|
80
|
-
},
|
|
81
|
-
sheetname: {
|
|
82
|
-
title: 'Sheetname',
|
|
83
|
-
type: 'text',
|
|
84
|
-
},
|
|
85
|
-
hideTabs: {
|
|
86
|
-
title: 'Hide tabs',
|
|
87
|
-
type: 'boolean',
|
|
88
|
-
default: false,
|
|
89
|
-
},
|
|
90
|
-
hideToolbar: {
|
|
91
|
-
title: 'Hide toolbar',
|
|
92
|
-
type: 'boolean',
|
|
93
|
-
default: false,
|
|
94
|
-
},
|
|
95
|
-
autoScale: {
|
|
96
|
-
title: 'Auto scale',
|
|
97
|
-
type: 'boolean',
|
|
98
|
-
default: false,
|
|
99
|
-
description: 'Scale down tableau according to width',
|
|
100
|
-
},
|
|
101
|
-
toolbarPosition: {
|
|
102
|
-
title: 'Toolbar position',
|
|
103
|
-
type: 'array',
|
|
104
|
-
choices: [
|
|
105
|
-
['Top', 'Top'],
|
|
106
|
-
['Bottom', 'Bottom'],
|
|
107
|
-
],
|
|
108
|
-
default: 'Top',
|
|
109
|
-
},
|
|
110
|
-
urlParameters: {
|
|
111
|
-
title: 'URL parameters',
|
|
112
|
-
widget: 'object_list',
|
|
113
|
-
schema: urlParametersSchema,
|
|
114
|
-
description: 'Set a list of url parameters to filter the tableau',
|
|
115
|
-
},
|
|
116
|
-
breakpointUrls: {
|
|
117
|
-
title: 'Breakpoint urls',
|
|
118
|
-
widget: 'object_list',
|
|
119
|
-
schema: breakpointUrlSchema(config),
|
|
120
|
-
description: 'Set different vizualization for specific breakpoint',
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
required: ['url'],
|
|
124
|
-
});
|
package/src/Widgets/style.less
DELETED
package/src/actions.js
DELETED
package/src/constants.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const SET_TABLEAU_API = 'SET_TABLEAU_API';
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
const useCopyToClipboard = (text) => {
|
|
4
|
-
const [copyStatus, setCopyStatus] = React.useState('inactive');
|
|
5
|
-
const copy = React.useCallback(() => {
|
|
6
|
-
navigator.clipboard.writeText(text).then(
|
|
7
|
-
() => setCopyStatus('copied'),
|
|
8
|
-
() => setCopyStatus('failed'),
|
|
9
|
-
);
|
|
10
|
-
}, [text]);
|
|
11
|
-
|
|
12
|
-
React.useEffect(() => {
|
|
13
|
-
if (copyStatus === 'inactive') {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const timeout = setTimeout(() => setCopyStatus('inactive'), 3000);
|
|
18
|
-
|
|
19
|
-
return () => clearTimeout(timeout);
|
|
20
|
-
}, [copyStatus]);
|
|
21
|
-
|
|
22
|
-
return [copyStatus, copy];
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export default useCopyToClipboard;
|
package/src/middleware.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { SET_TABLEAU_API } from '@eeacms/volto-tableau/constants';
|
|
2
|
-
|
|
3
|
-
//need to see if we need redux anymore for this
|
|
4
|
-
export default (middlewares) => [
|
|
5
|
-
(store) => (next) => (action) => {
|
|
6
|
-
const state = store.getState();
|
|
7
|
-
const { version = '' } = action || {};
|
|
8
|
-
|
|
9
|
-
if (
|
|
10
|
-
action.type === `${SET_TABLEAU_API}_PENDING` &&
|
|
11
|
-
!state.tableau.loading[version]
|
|
12
|
-
) {
|
|
13
|
-
// loadTableauScript(() => {}, version);
|
|
14
|
-
// fetchTableau(version)
|
|
15
|
-
// .then((response) => {
|
|
16
|
-
// if (mode === 'edit') {
|
|
17
|
-
// toast.success(<Toast success title={response.message} />);
|
|
18
|
-
// }
|
|
19
|
-
// store.dispatch({
|
|
20
|
-
// type: `${SET_TABLEAU_API}_SUCCESS`,
|
|
21
|
-
// version,
|
|
22
|
-
// api: response,
|
|
23
|
-
// });
|
|
24
|
-
// })
|
|
25
|
-
// .catch((error) => {
|
|
26
|
-
// if (mode === 'edit') {
|
|
27
|
-
// toast.error(<Toast error title={error.message} />);
|
|
28
|
-
// }
|
|
29
|
-
// store.dispatch({
|
|
30
|
-
// type: `${SET_TABLEAU_API}_FAILED`,
|
|
31
|
-
// version,
|
|
32
|
-
// });
|
|
33
|
-
// });
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return next(action);
|
|
37
|
-
},
|
|
38
|
-
...middlewares,
|
|
39
|
-
];
|
package/src/store.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { SET_TABLEAU_API } from '@eeacms/volto-tableau/constants';
|
|
2
|
-
|
|
3
|
-
const initialState = {
|
|
4
|
-
loading: {},
|
|
5
|
-
loaded: {},
|
|
6
|
-
errors: {},
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export default function tableau(state = initialState, action = {}) {
|
|
10
|
-
const loading = { ...state.loading };
|
|
11
|
-
const loaded = { ...state.loaded };
|
|
12
|
-
const errors = { ...state.errors };
|
|
13
|
-
|
|
14
|
-
switch (action.type) {
|
|
15
|
-
case `${SET_TABLEAU_API}_PENDING`:
|
|
16
|
-
loading[action.version] = true;
|
|
17
|
-
loaded[action.version] = false;
|
|
18
|
-
errors[action.version] = false;
|
|
19
|
-
|
|
20
|
-
return {
|
|
21
|
-
...state,
|
|
22
|
-
loading: {
|
|
23
|
-
...loading,
|
|
24
|
-
},
|
|
25
|
-
loaded: {
|
|
26
|
-
...loaded,
|
|
27
|
-
},
|
|
28
|
-
errors: {
|
|
29
|
-
...errors,
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
case `${SET_TABLEAU_API}_SUCCESS`:
|
|
34
|
-
loading[action.version] = false;
|
|
35
|
-
loaded[action.version] = true;
|
|
36
|
-
errors[action.version] = false;
|
|
37
|
-
return {
|
|
38
|
-
...state,
|
|
39
|
-
[action.version]: action.api,
|
|
40
|
-
loading: {
|
|
41
|
-
...loading,
|
|
42
|
-
},
|
|
43
|
-
loaded: {
|
|
44
|
-
...loaded,
|
|
45
|
-
},
|
|
46
|
-
errors: {
|
|
47
|
-
...errors,
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
case `${SET_TABLEAU_API}_FAILED`:
|
|
52
|
-
loading[action.version] = false;
|
|
53
|
-
loaded[action.version] = false;
|
|
54
|
-
errors[action.version] = true;
|
|
55
|
-
|
|
56
|
-
return {
|
|
57
|
-
...state,
|
|
58
|
-
loading: {
|
|
59
|
-
...loading,
|
|
60
|
-
},
|
|
61
|
-
loaded: {
|
|
62
|
-
...loaded,
|
|
63
|
-
},
|
|
64
|
-
errors: {
|
|
65
|
-
...errors,
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
default:
|
|
70
|
-
return state;
|
|
71
|
-
}
|
|
72
|
-
}
|