@eeacms/volto-tabs-block 2.0.0 → 2.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 CHANGED
@@ -4,8 +4,31 @@ 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
- #### [2.0.0](https://github.com/eea/volto-tabs-block/compare/1.3.2...2.0.0)
7
+ #### [2.1.0](https://github.com/eea/volto-tabs-block/compare/2.0.2...2.1.0)
8
8
 
9
+ - adjustments to tabs border [`#26`](https://github.com/eea/volto-tabs-block/pull/26)
10
+ - Release 2.1.0 [`3cdfa30`](https://github.com/eea/volto-tabs-block/commit/3cdfa30d4d03d864be8ad63f0648b4717298734a)
11
+ - Squashed commit of the following: [`ca241f5`](https://github.com/eea/volto-tabs-block/commit/ca241f56a96817679a1948154e2a8cc0e17b96fe)
12
+
13
+ #### [2.0.2](https://github.com/eea/volto-tabs-block/compare/2.0.1...2.0.2)
14
+
15
+ > 16 June 2022
16
+
17
+ - Fix Icon name warning: [`#25`](https://github.com/eea/volto-tabs-block/pull/25)
18
+
19
+ #### [2.0.1](https://github.com/eea/volto-tabs-block/compare/2.0.0...2.0.1)
20
+
21
+ > 10 June 2022
22
+
23
+ - Apply menu item style on tabs-block only [`#24`](https://github.com/eea/volto-tabs-block/pull/24)
24
+ - stylelint [`267fbdb`](https://github.com/eea/volto-tabs-block/commit/267fbdb72f69715690d281498d1fd0837c18fc0d)
25
+ - Prettier fix [`5ac20a8`](https://github.com/eea/volto-tabs-block/commit/5ac20a8352f00618dae1623ac200ea1779342e8d)
26
+
27
+ ### [2.0.0](https://github.com/eea/volto-tabs-block/compare/1.3.2...2.0.0)
28
+
29
+ > 8 June 2022
30
+
31
+ - Add accordion template for mobile [`#23`](https://github.com/eea/volto-tabs-block/pull/23)
9
32
  - Update [`525551e`](https://github.com/eea/volto-tabs-block/commit/525551e151d469f71e3ecbae9af994cf1dc61644)
10
33
  - Improve accordion variation [`e95977e`](https://github.com/eea/volto-tabs-block/commit/e95977e2b06178dd820ea1b1983d74b4fd3f38f5)
11
34
  - Release 2.0.0 [`1206ab1`](https://github.com/eea/volto-tabs-block/commit/1206ab1c22346761aacb9c5aba7c536e7407526e)
@@ -14,7 +37,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
14
37
  - stylelint [`d29ff73`](https://github.com/eea/volto-tabs-block/commit/d29ff739e17fe398373c289b01f57328543e333d)
15
38
  - stylelint [`73195f6`](https://github.com/eea/volto-tabs-block/commit/73195f60362fffe12ae13f685a9c349cbe486118)
16
39
  - prettier [`8308f52`](https://github.com/eea/volto-tabs-block/commit/8308f52c296f39da416c927d807f33741ecf66aa)
17
- - Add accordion template for mobile [`92e99cf`](https://github.com/eea/volto-tabs-block/commit/92e99cf538983164426ad82b0e71e5ba6532e419)
18
40
  - Remove useless from block title [`4ab8b58`](https://github.com/eea/volto-tabs-block/commit/4ab8b58b9266d2937fd033865e52100f0a6333b2)
19
41
 
20
42
  #### [1.3.2](https://github.com/eea/volto-tabs-block/compare/1.3.1...1.3.2)
package/Jenkinsfile CHANGED
@@ -4,8 +4,9 @@ pipeline {
4
4
  environment {
5
5
  GIT_NAME = "volto-tabs-block"
6
6
  NAMESPACE = "@eeacms"
7
- SONARQUBE_TAGS = "volto.eea.europa.eu,climate-energy.eea.europa.eu,biodiversity.europa.eu,www.eea.europa.eu-ims,sustainability.eionet.europa.eu,forest.eea.europa.eu,clms.land.copernicus.eu,industry.eea.europa.eu,water.europa.eu-freshwater,demo-www.eea.europa.eu,clmsdemo.devel6cph.eea.europa.eu"
7
+ SONARQUBE_TAGS = "volto.eea.europa.eu,climate-energy.eea.europa.eu,biodiversity.europa.eu,www.eea.europa.eu-ims,sustainability.eionet.europa.eu,forest.eea.europa.eu,clms.land.copernicus.eu,industry.eea.europa.eu,water.europa.eu-freshwater,demo-www.eea.europa.eu,clmsdemo.devel6cph.eea.europa.eu,circularity.eea.europa.eu"
8
8
  DEPENDENCIES = "@eeacms/volto-block-style"
9
+ VOLTO = "alpha"
9
10
  }
10
11
 
11
12
  stages {
@@ -124,8 +125,8 @@ pipeline {
124
125
  node(label: 'docker') {
125
126
  script {
126
127
  try {
127
- sh '''docker pull plone; docker run -d --rm --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="profile-plone.restapi:blocks" plone fg'''
128
- sh '''docker pull plone/volto-addon-ci; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" plone/volto-addon-ci cypress'''
128
+ sh '''docker pull eeacms/plone-backend; docker run --rm -d --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="eea.kitkat:testing" eeacms/plone-backend'''
129
+ sh '''docker pull plone/volto-addon-ci; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" -e NODE_ENV=development -e VOLTO="$VOLTO" plone/volto-addon-ci cypress'''
129
130
  } finally {
130
131
  try {
131
132
  sh '''rm -rf cypress-reports cypress-results cypress-coverage'''
@@ -27,7 +27,7 @@ coverage-end */
27
27
  export const setupBeforeEach = () => {
28
28
  cy.autologin();
29
29
  cy.createContent({
30
- contentType: 'Folder',
30
+ contentType: 'Document',
31
31
  contentId: 'cypress',
32
32
  contentTitle: 'Cypress',
33
33
  });
package/cypress.json CHANGED
@@ -1,9 +1,14 @@
1
1
  {
2
2
  "baseUrl": "http://localhost:3000",
3
3
  "viewportWidth": 1280,
4
- "defaultCommandTimeout": 15000,
4
+ "defaultCommandTimeout": 8888,
5
+ "chromeWebSecurity": false,
5
6
  "reporter": "junit",
6
7
  "video": true,
8
+ "retries": {
9
+ "runMode": 8,
10
+ "openMode": 0
11
+ },
7
12
  "reporterOptions": {
8
13
  "mochaFile": "cypress/reports/cypress-[hash].xml",
9
14
  "jenkinsMode": true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-tabs-block",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "volto-tabs-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -77,7 +77,9 @@ const View = (props) => {
77
77
  title: (
78
78
  <>
79
79
  {semanticIcon ? (
80
- <Icon name={active ? semanticIcon.opened : semanticIcon.closed} />
80
+ <Icon
81
+ className={active ? semanticIcon.opened : semanticIcon.closed}
82
+ />
81
83
  ) : (
82
84
  <VoltoIcon
83
85
  name={active ? icons.opened : icons.closed}
@@ -285,7 +285,14 @@ const Edit = (props) => {
285
285
  tabular: getDataValue('menuTabular'),
286
286
  text: getDataValue('menuText'),
287
287
  vertical: menuPosition.vertical,
288
- className: cx(data.menuAlign, { container: isContainer }),
288
+ className: cx(
289
+ data.menuAlign,
290
+ menuPosition.direction === 'left' ? 'border-right' : '',
291
+ menuPosition.direction === 'right' ? 'border-left' : '',
292
+ menuPosition.direction === 'top' ? 'border-bottom' : '',
293
+ menuPosition.direction === 'bottom' ? 'border-top' : '',
294
+ { container: isContainer },
295
+ ),
289
296
  }}
290
297
  menuPosition={menuPosition.direction}
291
298
  panes={panes}
@@ -64,7 +64,15 @@ const View = (props) => {
64
64
  hashlink = {},
65
65
  setActiveTab = () => {},
66
66
  } = props;
67
- const menuPosition = getMenuPosition(data);
67
+
68
+ const [menuPosition, setMenuPosition] = React.useState({});
69
+
70
+ React.useEffect(() => {
71
+ if (Object.keys(menuPosition).length === 0) {
72
+ setMenuPosition(getMenuPosition(data));
73
+ }
74
+ }, [data, menuPosition]);
75
+
68
76
  const isContainer = data.align === 'full';
69
77
  const tabsTitle = data.title;
70
78
  const tabsDescription = data.description;
@@ -157,7 +165,14 @@ const View = (props) => {
157
165
  tabular: getDataValue('menuTabular'),
158
166
  text: getDataValue('menuText'),
159
167
  vertical: menuPosition.vertical,
160
- className: cx(data.menuAlign, { container: isContainer }),
168
+ className: cx(
169
+ data.menuAlign,
170
+ menuPosition.direction === 'left' ? 'border-right' : '',
171
+ menuPosition.direction === 'right' ? 'border-left' : '',
172
+ menuPosition.direction === 'top' ? 'border-bottom' : '',
173
+ menuPosition.direction === 'bottom' ? 'border-top' : '',
174
+ { container: isContainer },
175
+ ),
161
176
  }}
162
177
  menuPosition={menuPosition.direction}
163
178
  panes={panes}
@@ -77,6 +77,10 @@
77
77
  .menu-item-count {
78
78
  display: @menuItemCountDisplay;
79
79
  }
80
+
81
+ &.active {
82
+ border-width: 0.2rem;
83
+ }
80
84
  }
81
85
 
82
86
  .ui.fluid.input {
@@ -118,143 +122,143 @@
118
122
  }
119
123
  }
120
124
  }
121
- }
122
125
 
123
- .ui.menu:not(.RRT__accordion) {
124
- .ui.item .icon {
125
- display: none;
126
+ .ui.menu:not(.RRT__accordion) {
127
+ .ui.item .icon {
128
+ display: none;
129
+ }
126
130
  }
127
- }
128
131
 
129
- .RRT__container {
130
- > .ui.tab .rah-animating {
131
- transition: height 0ms ease 0ms !important;
132
+ .RRT__container {
133
+ > .ui.tab .rah-animating {
134
+ transition: height 0ms ease 0ms !important;
132
135
 
133
- > div {
134
- transition: opacity 0ms ease 0ms !important;
136
+ > div {
137
+ transition: opacity 0ms ease 0ms !important;
138
+ }
135
139
  }
136
140
  }
137
- }
138
-
139
- .ui.menu.RRT__accordion {
140
- &::before {
141
- display: none;
142
- }
143
141
 
144
- border-bottom: none !important;
142
+ .ui.menu.RRT__accordion {
143
+ &::before {
144
+ display: none;
145
+ }
145
146
 
146
- .ui.item {
147
- display: flex;
148
- width: 100%;
149
- padding: 0.75rem 1rem !important;
150
- border-width: 0 !important;
151
147
  border-bottom: none !important;
152
- margin: 0 !important;
153
- background-color: @accordionMenuItemBackground;
154
148
 
155
- .icon {
149
+ .ui.item {
150
+ display: flex;
151
+ width: 100%;
152
+ padding: 0.75rem 1rem !important;
153
+ border-width: 0 !important;
154
+ border-bottom: none !important;
156
155
  margin: 0 !important;
157
- }
156
+ background-color: @accordionMenuItemBackground;
158
157
 
159
- .dropdown.icon {
160
- transform: rotate(-90deg);
161
- }
158
+ .icon {
159
+ margin: 0 !important;
160
+ }
162
161
 
163
- &.active {
164
162
  .dropdown.icon {
165
- transform: rotate(0);
163
+ transform: rotate(-90deg);
164
+ }
165
+
166
+ &.active {
167
+ .dropdown.icon {
168
+ transform: rotate(0);
169
+ }
166
170
  }
167
171
  }
168
- }
169
172
 
170
- &.red {
171
- .ui.item.active {
172
- background-color: @red !important;
173
- color: #fff !important;
173
+ &.red {
174
+ .ui.item.active {
175
+ background-color: @red !important;
176
+ color: #fff !important;
177
+ }
174
178
  }
175
- }
176
179
 
177
- &.orange {
178
- .ui.item.active {
179
- background-color: @orange !important;
180
- color: #fff !important;
180
+ &.orange {
181
+ .ui.item.active {
182
+ background-color: @orange !important;
183
+ color: #fff !important;
184
+ }
181
185
  }
182
- }
183
186
 
184
- &.yellow {
185
- .ui.item.active {
186
- background-color: @yellow !important;
187
- color: #fff !important;
187
+ &.yellow {
188
+ .ui.item.active {
189
+ background-color: @yellow !important;
190
+ color: #fff !important;
191
+ }
188
192
  }
189
- }
190
193
 
191
- &.olive {
192
- .ui.item.active {
193
- background-color: @olive !important;
194
- color: #fff !important;
194
+ &.olive {
195
+ .ui.item.active {
196
+ background-color: @olive !important;
197
+ color: #fff !important;
198
+ }
195
199
  }
196
- }
197
200
 
198
- &.green {
199
- .ui.item.active {
200
- background-color: @green !important;
201
- color: #fff !important;
201
+ &.green {
202
+ .ui.item.active {
203
+ background-color: @green !important;
204
+ color: #fff !important;
205
+ }
202
206
  }
203
- }
204
207
 
205
- &.teal {
206
- .ui.item.active {
207
- background-color: @teal !important;
208
- color: #fff !important;
208
+ &.teal {
209
+ .ui.item.active {
210
+ background-color: @teal !important;
211
+ color: #fff !important;
212
+ }
209
213
  }
210
- }
211
214
 
212
- &.blue {
213
- .ui.item.active {
214
- background-color: @blue !important;
215
- color: #fff !important;
215
+ &.blue {
216
+ .ui.item.active {
217
+ background-color: @blue !important;
218
+ color: #fff !important;
219
+ }
216
220
  }
217
- }
218
221
 
219
- &.violet {
220
- .ui.item.active {
221
- background-color: @violet !important;
222
- color: #fff !important;
222
+ &.violet {
223
+ .ui.item.active {
224
+ background-color: @violet !important;
225
+ color: #fff !important;
226
+ }
223
227
  }
224
- }
225
228
 
226
- &.purple {
227
- .ui.item.active {
228
- background-color: @purple !important;
229
- color: #fff !important;
229
+ &.purple {
230
+ .ui.item.active {
231
+ background-color: @purple !important;
232
+ color: #fff !important;
233
+ }
230
234
  }
231
- }
232
235
 
233
- &.brown {
234
- .ui.item.active {
235
- background-color: @brown !important;
236
- color: #fff !important;
236
+ &.brown {
237
+ .ui.item.active {
238
+ background-color: @brown !important;
239
+ color: #fff !important;
240
+ }
237
241
  }
238
- }
239
242
 
240
- &.grey {
241
- .ui.item.active {
242
- background-color: @grey !important;
243
- color: #fff !important;
243
+ &.grey {
244
+ .ui.item.active {
245
+ background-color: @grey !important;
246
+ color: #fff !important;
247
+ }
244
248
  }
245
- }
246
249
 
247
- &.black {
248
- .ui.item.active {
249
- background-color: @black !important;
250
- color: #fff !important;
250
+ &.black {
251
+ .ui.item.active {
252
+ background-color: @black !important;
253
+ color: #fff !important;
254
+ }
251
255
  }
252
- }
253
256
 
254
- .ui.tab {
255
- padding: 1rem;
256
- margin-bottom: 0;
257
- background-color: @accordionTabBackground !important;
257
+ .ui.tab {
258
+ padding: 1rem;
259
+ margin-bottom: 0;
260
+ background-color: @accordionTabBackground !important;
261
+ }
258
262
  }
259
263
  }
260
264
 
@@ -17,9 +17,12 @@ const getMenuPosition = (data) => {
17
17
  if (['bottom'].includes(position)) {
18
18
  return {
19
19
  attached: position,
20
+ direction: position,
20
21
  };
21
22
  }
22
- return {};
23
+ return {
24
+ direction: position,
25
+ };
23
26
  };
24
27
 
25
28
  const toggleItem = (container, item, hidden) => {