@eeacms/volto-tabs-block 1.3.0 → 1.3.1
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
CHANGED
|
@@ -4,8 +4,15 @@ 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
|
+
#### [1.3.1](https://github.com/eea/volto-tabs-block/compare/1.3.0...1.3.1)
|
|
8
|
+
|
|
9
|
+
- Style fix + missing key [`0d2b097`](https://github.com/eea/volto-tabs-block/commit/0d2b097850bc89d8a525ce8a4564a348975d33b9)
|
|
10
|
+
|
|
7
11
|
#### [1.3.0](https://github.com/eea/volto-tabs-block/compare/1.2.12...1.3.0)
|
|
8
12
|
|
|
13
|
+
> 6 April 2022
|
|
14
|
+
|
|
15
|
+
- Refactor tabs block [`#19`](https://github.com/eea/volto-tabs-block/pull/19)
|
|
9
16
|
- Refactor tabs block [`#18`](https://github.com/eea/volto-tabs-block/pull/18)
|
|
10
17
|
- Fix tests [`fdc74d9`](https://github.com/eea/volto-tabs-block/commit/fdc74d9f5f1c851de9ca3a9576cf2dbcd1495968)
|
|
11
18
|
- Bump version [`acfef41`](https://github.com/eea/volto-tabs-block/commit/acfef413eb9f923f7a7283d12417e23c81192633)
|
package/Jenkinsfile
CHANGED
|
@@ -184,10 +184,10 @@ pipeline {
|
|
|
184
184
|
unstash "xunit-reports"
|
|
185
185
|
unstash "cypress-coverage"
|
|
186
186
|
def scannerHome = tool 'SonarQubeScanner';
|
|
187
|
-
def nodeJS = tool '
|
|
187
|
+
def nodeJS = tool 'NodeJS';
|
|
188
188
|
withSonarQubeEnv('Sonarqube') {
|
|
189
189
|
sh '''sed -i "s#/opt/frontend/my-volto-project/src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
|
|
190
|
-
sh "export PATH=$
|
|
190
|
+
sh "export PATH=${scannerHome}/bin:${nodeJS}/bin:$PATH; sonar-scanner -Dsonar.javascript.lcov.reportPaths=./xunit-reports/coverage/lcov.info,./cypress-coverage/coverage/lcov.info -Dsonar.sources=./src -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER"
|
|
191
191
|
sh '''try=2; while [ \$try -gt 0 ]; do curl -s -XPOST -u "${SONAR_AUTH_TOKEN}:" "${SONAR_HOST_URL}api/project_tags/set?project=${GIT_NAME}-${BRANCH_NAME}&tags=${SONARQUBE_TAGS},${BRANCH_NAME}" > set_tags_result; if [ \$(grep -ic error set_tags_result ) -eq 0 ]; then try=0; else cat set_tags_result; echo "... Will retry"; sleep 60; try=\$(( \$try - 1 )); fi; done'''
|
|
192
192
|
}
|
|
193
193
|
}
|
package/package.json
CHANGED
|
@@ -61,15 +61,16 @@ const MenuWrapper = (props) => {
|
|
|
61
61
|
tabsList = [],
|
|
62
62
|
setActiveTab = () => {},
|
|
63
63
|
} = props;
|
|
64
|
+
const [open, setOpen] = React.useState(false);
|
|
64
65
|
|
|
65
66
|
React.useEffect(() => {
|
|
66
67
|
if (!true || !node?.current) return;
|
|
67
68
|
const items = node.current.querySelectorAll(
|
|
68
69
|
'.ui.menu > .menu-wrapper > .item:not(.menu-title)',
|
|
69
70
|
);
|
|
70
|
-
const
|
|
71
|
-
if (!
|
|
72
|
-
const overflowOffset = positionedOffset(
|
|
71
|
+
const underlineDropdown = node.current.querySelector('.ui.dropdown');
|
|
72
|
+
if (!underlineDropdown) return;
|
|
73
|
+
const overflowOffset = positionedOffset(underlineDropdown, node.current);
|
|
73
74
|
if (!overflowOffset) {
|
|
74
75
|
return;
|
|
75
76
|
}
|
|
@@ -83,8 +84,11 @@ const MenuWrapper = (props) => {
|
|
|
83
84
|
anyHidden = anyHidden || hidden;
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
underlineDropdown.style.visibility = anyHidden ? '' : 'hidden';
|
|
88
|
+
if (!anyHidden && open) {
|
|
89
|
+
setOpen(false);
|
|
90
|
+
}
|
|
91
|
+
}, [screen, node, open, data.isResponsive]);
|
|
88
92
|
|
|
89
93
|
return (
|
|
90
94
|
<React.Fragment>
|
|
@@ -95,39 +99,38 @@ const MenuWrapper = (props) => {
|
|
|
95
99
|
</React.Fragment>
|
|
96
100
|
))}
|
|
97
101
|
</div>
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
102
|
+
<Dropdown
|
|
103
|
+
icon="ellipsis horizontal"
|
|
104
|
+
className="item"
|
|
105
|
+
pointing="top right"
|
|
106
|
+
open={open}
|
|
107
|
+
onOpen={() => setOpen(true)}
|
|
108
|
+
onClose={() => setOpen(false)}
|
|
109
|
+
>
|
|
110
|
+
<Dropdown.Menu>
|
|
111
|
+
{tabsList.map((underlineTab, underlineIndex) => {
|
|
112
|
+
const title = tabs[underlineTab].title;
|
|
113
|
+
const defaultTitle = `Tab ${underlineIndex + 1}`;
|
|
108
114
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
</Dropdown.Menu>
|
|
129
|
-
</Dropdown>
|
|
130
|
-
)}
|
|
115
|
+
return (
|
|
116
|
+
<Dropdown.Item
|
|
117
|
+
hidden
|
|
118
|
+
key={`underline-tab-${underlineIndex}-${underlineTab}`}
|
|
119
|
+
underline-item-data={underlineTab}
|
|
120
|
+
active={underlineTab === activeTab}
|
|
121
|
+
onClick={() => {
|
|
122
|
+
if (activeTab !== underlineTab) {
|
|
123
|
+
setActiveTab(underlineTab);
|
|
124
|
+
}
|
|
125
|
+
}}
|
|
126
|
+
>
|
|
127
|
+
<span className={'menu-item-count'}>{underlineIndex + 1}</span>
|
|
128
|
+
<p className={'menu-item-text'}>{title || defaultTitle}</p>
|
|
129
|
+
</Dropdown.Item>
|
|
130
|
+
);
|
|
131
|
+
})}
|
|
132
|
+
</Dropdown.Menu>
|
|
133
|
+
</Dropdown>
|
|
131
134
|
</React.Fragment>
|
|
132
135
|
);
|
|
133
136
|
};
|
|
@@ -201,6 +204,7 @@ const View = (props) => {
|
|
|
201
204
|
menuItem: (
|
|
202
205
|
<MenuItem
|
|
203
206
|
{...props}
|
|
207
|
+
key={tab}
|
|
204
208
|
tab={tab}
|
|
205
209
|
tabsList={tabsList}
|
|
206
210
|
index={index}
|
|
@@ -245,7 +249,6 @@ const View = (props) => {
|
|
|
245
249
|
text: getDataValue('menuText'),
|
|
246
250
|
vertical: menuPosition.vertical,
|
|
247
251
|
className: cx(data.menuAlign, { container: isContainer }),
|
|
248
|
-
items: undefined,
|
|
249
252
|
children: (
|
|
250
253
|
<MenuWrapper
|
|
251
254
|
{...props}
|