design-comuni-plone-theme 10.4.0 → 10.4.2
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/.eslintrc.js +1 -1
- package/CHANGELOG.md +39 -0
- package/RELEASE.md +18 -0
- package/error-503.html +52 -50
- package/package.json +40 -24
- package/publiccode.yml +2 -2
- package/src/actions/getDettagliProcedimento.js +1 -2
- package/src/components/ItaliaTheme/Blocks/Listing/BandiInEvidenceTemplate.jsx +108 -104
- package/src/components/ItaliaTheme/Blocks/Listing/CardWithSlideUpTextTemplate.jsx +8 -10
- package/src/components/ItaliaTheme/Blocks/TextCard/SimpleCard/Block.jsx +1 -7
- package/src/components/ItaliaTheme/Blocks/__tests__/Alert.test.jsx +1 -2
- package/src/components/ItaliaTheme/Blocks/__tests__/CardWithImage.test.jsx +1 -2
- package/src/components/ItaliaTheme/Header/HeaderSlim/UserLoggedMenu.jsx +0 -1
- package/src/components/ItaliaTheme/Icons/FontAwesomeIcon.jsx +2 -2
- package/src/components/ItaliaTheme/Pagination/PaginationItem.jsx +2 -8
- package/src/components/ItaliaTheme/Pagination/createPaginationItems/itemFactories.js +4 -4
- package/src/components/ItaliaTheme/Search/utils.js +5 -3
- package/src/components/ItaliaTheme/View/Commons/ContactsCard.jsx +4 -4
- package/src/components/ItaliaTheme/View/Commons/DownloadFileFormat.jsx +1 -0
- package/src/components/ItaliaTheme/View/__tests__/PersonaView.test.jsx +928 -932
- package/src/components/ItaliaTheme/manage/Widgets/TextEditorWidget.jsx +12 -8
- package/src/components/SelectInput/SelectInput.jsx +16 -21
- package/src/components/SelectInput/select-styles.css +1 -1
- package/src/config/Blocks/blocks.js +4 -3
- package/src/config/Blocks/listingVariations.js +4 -3
- package/src/config/Subsites/index.js +16 -16
- package/src/config/italiaConfig.js +6 -5
- package/src/customizations/volto/components/manage/Blocks/HeroImageLeft/Edit.jsx +31 -26
- package/src/customizations/volto/components/manage/Blocks/Listing/ListingBody.jsx +2 -2
- package/src/customizations/volto/components/manage/Blocks/Listing/withQuerystringResults.jsx +6 -6
- package/src/customizations/volto/components/manage/Blocks/Search/components/CheckboxFacet.jsx +2 -2
- package/src/customizations/volto/components/manage/Blocks/Search/components/FilterList.jsx +15 -20
- package/src/customizations/volto/components/manage/Blocks/Search/components/ToggleFacetFilterListEntry.jsx +2 -9
- package/src/customizations/volto/components/manage/Diff/DiffField.jsx +2 -9
- package/src/customizations/volto/components/manage/Sidebar/ObjectBrowserBody.jsx +10 -10
- package/src/customizations/volto/components/manage/Widgets/DatetimeWidget.jsx +4 -10
- package/src/customizations/volto/components/manage/Widgets/ObjectBrowserWidget.jsx +2 -9
- package/src/customizations/volto/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.jsx +2 -2
- package/src/customizations/volto/helpers/FormValidation/FormValidation.js +7 -6
- package/src/customizations/volto/helpers/Html/Html.jsx +2 -2
- package/src/customizations/volto/middleware/api.js +194 -190
- package/src/customizations/volto/middleware/blacklistRoutes.js +36 -34
- package/src/helpers/dates.js +2 -2
- package/src/theme/ItaliaTheme/Addons/volto-gdpr-privacy.scss +12 -5
- package/src/theme/ItaliaTheme/Blocks/_accordion.scss +2 -0
- package/src/theme/ItaliaTheme/Blocks/_alert.scss +1 -1
- package/src/theme/ItaliaTheme/Blocks/_bandiInEvidenceTemplate.scss +6 -1
- package/src/theme/ItaliaTheme/Blocks/_calendar.scss +8 -6
- package/src/theme/ItaliaTheme/Blocks/_cardWithImageAndInEvidence.scss +7 -7
- package/src/theme/ItaliaTheme/Blocks/_cardWithSlideUpTextTemplate.scss +5 -4
- package/src/theme/ItaliaTheme/Blocks/_completeBlockLinkstemplate.scss +4 -2
- package/src/theme/ItaliaTheme/Blocks/_countdown.scss +2 -2
- package/src/theme/ItaliaTheme/Blocks/_ctaBlock.scss +7 -5
- package/src/theme/ItaliaTheme/Blocks/_gridBlock.scss +8 -3
- package/src/theme/ItaliaTheme/Blocks/_gridGalleryTemplate.scss +1 -0
- package/src/theme/ItaliaTheme/Blocks/_hero.scss +1 -0
- package/src/theme/ItaliaTheme/Blocks/_iconBlocks.scss +2 -2
- package/src/theme/ItaliaTheme/Blocks/_imageBlock.scss +1 -0
- package/src/theme/ItaliaTheme/Blocks/_listing.scss +1 -1
- package/src/theme/ItaliaTheme/Blocks/_photogallerytemplate.scss +1 -0
- package/src/theme/ItaliaTheme/Blocks/_ribbonCardTemplate.scss +5 -4
- package/src/theme/ItaliaTheme/Blocks/_rssBlock.scss +3 -2
- package/src/theme/ItaliaTheme/Blocks/_search.scss +72 -36
- package/src/theme/ItaliaTheme/Blocks/_searchSections.scss +4 -3
- package/src/theme/ItaliaTheme/Blocks/_simpleCardTemplate.scss +6 -3
- package/src/theme/ItaliaTheme/Blocks/_sliderTemplate.scss +1 -1
- package/src/theme/ItaliaTheme/Blocks/_smallblockLinkstemplate.scss +3 -3
- package/src/theme/ItaliaTheme/Blocks/_subblocks-edit.scss +1 -1
- package/src/theme/ItaliaTheme/Blocks/_tableOfContents.scss +17 -7
- package/src/theme/ItaliaTheme/Blocks/_video.scss +1 -1
- package/src/theme/ItaliaTheme/Blocks/_videoGallery.scss +7 -6
- package/src/theme/ItaliaTheme/Components/_card.scss +14 -7
- package/src/theme/ItaliaTheme/Components/_cardPersona.scss +2 -2
- package/src/theme/ItaliaTheme/Components/_cmp-timeline.scss +16 -14
- package/src/theme/ItaliaTheme/Components/_contactsCard.scss +3 -3
- package/src/theme/ItaliaTheme/Components/_customerSatisfaction.scss +31 -11
- package/src/theme/ItaliaTheme/Components/_diffField.scss +25 -14
- package/src/theme/ItaliaTheme/Components/_galleryPreview.scss +10 -10
- package/src/theme/ItaliaTheme/Components/_mobileMenu.scss +1 -1
- package/src/theme/ItaliaTheme/Components/_navscroll.scss +2 -0
- package/src/theme/ItaliaTheme/Components/_pageHeader.scss +5 -4
- package/src/theme/ItaliaTheme/Components/_scrollToTop.scss +1 -0
- package/src/theme/ItaliaTheme/Components/_sharing.scss +1 -1
- package/src/theme/ItaliaTheme/Components/_sideMenu.scss +9 -5
- package/src/theme/ItaliaTheme/Components/_subsiteFooter.scss +1 -1
- package/src/theme/ItaliaTheme/Print/_all_pages.scss +5 -2
- package/src/theme/ItaliaTheme/Print/_bandi.scss +8 -8
- package/src/theme/ItaliaTheme/Print/_event.scss +11 -10
- package/src/theme/ItaliaTheme/Print/_news_items.scss +17 -17
- package/src/theme/ItaliaTheme/Print/_persona.scss +8 -8
- package/src/theme/ItaliaTheme/Print/_servizio.scss +8 -8
- package/src/theme/ItaliaTheme/Views/_bando.scss +1 -0
- package/src/theme/ItaliaTheme/Views/_cartellaModulistica.scss +20 -8
- package/src/theme/ItaliaTheme/Views/_common.scss +4 -3
- package/src/theme/ItaliaTheme/Views/_embeddedVideo.scss +1 -1
- package/src/theme/ItaliaTheme/Views/_evento.scss +1 -0
- package/src/theme/ItaliaTheme/Views/_faqFolder.scss +1 -0
- package/src/theme/ItaliaTheme/Views/_paginaArgomento.scss +1 -0
- package/src/theme/ItaliaTheme/Views/_puntoDiContatto.scss +1 -0
- package/src/theme/ItaliaTheme/Views/_servizio.scss +4 -1
- package/src/theme/ItaliaTheme/Views/_slider.scss +3 -3
- package/src/theme/ItaliaTheme/Views/_trasparenzaView.scss +2 -0
- package/src/theme/ItaliaTheme/Views/_uo.scss +3 -1
- package/src/theme/ItaliaTheme/Views/_venue.scss +3 -2
- package/src/theme/ItaliaTheme/Widgets/_canaleDigitaleWidget.scss +2 -1
- package/src/theme/ItaliaTheme/Widgets/_dataGridWidget.scss +24 -8
- package/src/theme/ItaliaTheme/Widgets/_iconWidget.scss +1 -1
- package/src/theme/ItaliaTheme/_common.scss +9 -4
- package/src/theme/ItaliaTheme/_main.scss +11 -8
- package/src/theme/_cms-ui.scss +46 -23
- package/src/theme/_cms-ui_container.scss +8 -3
- package/src/theme/_site-variables.scss +4 -2
- package/src/theme/bootstrap-override/bootstrap-italia/_breadcrumb.scss +1 -1
- package/src/theme/bootstrap-override/bootstrap-italia/_footer.scss +9 -4
- package/src/theme/bootstrap-override/bootstrap-italia/_linklist.scss +2 -0
- package/src/theme/bootstrap-override/bootstrap-italia/_megamenu.scss +1 -0
- package/src/theme/bootstrap-override/bootstrap-italia/_point-list.scss +4 -3
- package/src/theme/extras/_checkbox.scss +1 -1
- package/src/theme/extras/_modals.scss +5 -3
- package/src/theme/extras/_search.scss +14 -4
- package/src/theme/extras/_sidebar.scss +3 -0
|
@@ -128,58 +128,76 @@ function sendOnSocket(request) {
|
|
|
128
128
|
* @param {Object} api Api object.
|
|
129
129
|
* @returns {Promise} Action promise.
|
|
130
130
|
*/
|
|
131
|
-
const apiMiddlewareFactory =
|
|
132
|
-
|
|
133
|
-
) =>
|
|
134
|
-
|
|
131
|
+
const apiMiddlewareFactory =
|
|
132
|
+
(api) =>
|
|
133
|
+
({ dispatch, getState }) =>
|
|
134
|
+
(next) =>
|
|
135
|
+
(action) => {
|
|
136
|
+
const { settings } = config;
|
|
135
137
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
138
|
+
const token = getState().userSession.token;
|
|
139
|
+
let isAnonymous = true;
|
|
140
|
+
if (token) {
|
|
141
|
+
const tokenExpiration = jwtDecode(token).exp;
|
|
142
|
+
const currentTime = new Date().getTime() / 1000;
|
|
143
|
+
isAnonymous = !token || currentTime > tokenExpiration;
|
|
144
|
+
}
|
|
143
145
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
146
|
+
if (typeof action === 'function') {
|
|
147
|
+
return action(dispatch, getState);
|
|
148
|
+
}
|
|
147
149
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
+
const { request, type, mode = 'parallel', ...rest } = action;
|
|
151
|
+
const { subrequest } = action; // We want subrequest remains in `...rest` above
|
|
150
152
|
|
|
151
|
-
|
|
153
|
+
let actionPromise;
|
|
152
154
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
155
|
+
if (!request) {
|
|
156
|
+
return next(action);
|
|
157
|
+
}
|
|
156
158
|
|
|
157
|
-
|
|
159
|
+
next({ ...rest, type: `${type}_PENDING` });
|
|
158
160
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
161
|
+
if (socket) {
|
|
162
|
+
actionPromise = Array.isArray(request)
|
|
163
|
+
? Promise.all(
|
|
164
|
+
request.map((item) =>
|
|
165
|
+
sendOnSocket({
|
|
166
|
+
...item,
|
|
167
|
+
path: addExpandersToPath(item.path, type, isAnonymous),
|
|
168
|
+
id: type,
|
|
169
|
+
}),
|
|
170
|
+
),
|
|
171
|
+
)
|
|
172
|
+
: sendOnSocket({
|
|
173
|
+
...request,
|
|
174
|
+
path: addExpandersToPath(request.path, type, isAnonymous),
|
|
175
|
+
id: type,
|
|
176
|
+
});
|
|
177
|
+
} else {
|
|
178
|
+
actionPromise = Array.isArray(request)
|
|
179
|
+
? mode === 'serial'
|
|
180
|
+
? request.reduce((prevPromise, item) => {
|
|
181
|
+
return prevPromise.then((acc) => {
|
|
182
|
+
return api[item.op](
|
|
183
|
+
addExpandersToPath(item.path, type, isAnonymous),
|
|
184
|
+
{
|
|
185
|
+
data: item.data,
|
|
186
|
+
type: item.type,
|
|
187
|
+
headers: item.headers,
|
|
188
|
+
params: request.params,
|
|
189
|
+
checkUrl: settings.actions_raising_api_errors.includes(
|
|
190
|
+
action.type,
|
|
191
|
+
),
|
|
192
|
+
},
|
|
193
|
+
).then((reqres) => {
|
|
194
|
+
return [...acc, reqres];
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
}, Promise.resolve([]))
|
|
198
|
+
: Promise.all(
|
|
199
|
+
request.map((item) =>
|
|
200
|
+
api[item.op](addExpandersToPath(item.path, type, isAnonymous), {
|
|
183
201
|
data: item.data,
|
|
184
202
|
type: item.type,
|
|
185
203
|
headers: item.headers,
|
|
@@ -187,176 +205,162 @@ const apiMiddlewareFactory = (api) => ({ dispatch, getState }) => (next) => (
|
|
|
187
205
|
checkUrl: settings.actions_raising_api_errors.includes(
|
|
188
206
|
action.type,
|
|
189
207
|
),
|
|
190
|
-
},
|
|
191
|
-
)
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
request.
|
|
198
|
-
|
|
199
|
-
data: item.data,
|
|
200
|
-
type: item.type,
|
|
201
|
-
headers: item.headers,
|
|
202
|
-
params: request.params,
|
|
203
|
-
checkUrl: settings.actions_raising_api_errors.includes(
|
|
204
|
-
action.type,
|
|
205
|
-
),
|
|
206
|
-
}),
|
|
207
|
-
),
|
|
208
|
-
)
|
|
209
|
-
: api[request.op](addExpandersToPath(request.path, type, isAnonymous), {
|
|
210
|
-
data: request.data,
|
|
211
|
-
type: request.type,
|
|
212
|
-
headers: request.headers,
|
|
213
|
-
params: request.params,
|
|
214
|
-
checkUrl: settings.actions_raising_api_errors.includes(action.type),
|
|
215
|
-
});
|
|
216
|
-
actionPromise.then(
|
|
217
|
-
(result) => {
|
|
218
|
-
const { settings } = config;
|
|
219
|
-
if (getState().apierror.connectionRefused) {
|
|
220
|
-
next({
|
|
221
|
-
...rest,
|
|
222
|
-
type: RESET_APIERROR,
|
|
208
|
+
}),
|
|
209
|
+
),
|
|
210
|
+
)
|
|
211
|
+
: api[request.op](addExpandersToPath(request.path, type, isAnonymous), {
|
|
212
|
+
data: request.data,
|
|
213
|
+
type: request.type,
|
|
214
|
+
headers: request.headers,
|
|
215
|
+
params: request.params,
|
|
216
|
+
checkUrl: settings.actions_raising_api_errors.includes(action.type),
|
|
223
217
|
});
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
const
|
|
227
|
-
if (
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
config.settings.supportedLanguages.includes(lang)
|
|
232
|
-
) {
|
|
233
|
-
const langFileName = toGettextLang(lang);
|
|
234
|
-
import('~/../locales/' + langFileName + '.json').then((locale) => {
|
|
235
|
-
dispatch(changeLanguage(lang, locale.default));
|
|
218
|
+
actionPromise.then(
|
|
219
|
+
(result) => {
|
|
220
|
+
const { settings } = config;
|
|
221
|
+
if (getState().apierror.connectionRefused) {
|
|
222
|
+
next({
|
|
223
|
+
...rest,
|
|
224
|
+
type: RESET_APIERROR,
|
|
236
225
|
});
|
|
237
226
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
227
|
+
if (type === GET_CONTENT) {
|
|
228
|
+
const lang = result?.language?.token;
|
|
229
|
+
if (
|
|
230
|
+
lang &&
|
|
231
|
+
getState().intl.locale !== toReactIntlLang(lang) &&
|
|
232
|
+
!subrequest &&
|
|
233
|
+
config.settings.supportedLanguages.includes(lang)
|
|
234
|
+
) {
|
|
235
|
+
const langFileName = toGettextLang(lang);
|
|
236
|
+
import('~/../locales/' + langFileName + '.json').then(
|
|
237
|
+
(locale) => {
|
|
238
|
+
dispatch(changeLanguage(lang, locale.default));
|
|
239
|
+
},
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
if (type === LOGIN && settings.websockets) {
|
|
244
|
+
const cookies = new Cookies();
|
|
245
|
+
cookies.set(
|
|
246
|
+
'auth_token',
|
|
247
|
+
result.token,
|
|
248
|
+
getCookieOptions({
|
|
249
|
+
expires: new Date(jwtDecode(result.token).exp * 1000),
|
|
250
|
+
}),
|
|
253
251
|
);
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
next({
|
|
275
|
-
...rest,
|
|
276
|
-
error: { status: 500, error },
|
|
277
|
-
type: `${type}_FAIL`,
|
|
278
|
-
});
|
|
279
|
-
// Rethrow the original exception on the client side only,
|
|
280
|
-
// so it doesn't fall through to express on the server.
|
|
281
|
-
if (__CLIENT__) throw error;
|
|
282
|
-
}
|
|
283
|
-
},
|
|
284
|
-
(error) => {
|
|
285
|
-
// Only SSR can set ECONNREFUSED
|
|
286
|
-
if (error.code === 'ECONNREFUSED') {
|
|
287
|
-
next({
|
|
288
|
-
...rest,
|
|
289
|
-
error,
|
|
290
|
-
statusCode: error.code,
|
|
291
|
-
connectionRefused: true,
|
|
292
|
-
type: SET_APIERROR,
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
// Response error is marked crossDomain if CORS error happen
|
|
297
|
-
else if (error.crossDomain) {
|
|
298
|
-
next({
|
|
299
|
-
...rest,
|
|
300
|
-
error,
|
|
301
|
-
statusCode: 'CORSERROR',
|
|
302
|
-
connectionRefused: false,
|
|
303
|
-
type: SET_APIERROR,
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
// Check for actions who can raise api errors
|
|
308
|
-
if (settings.actions_raising_api_errors.includes(action.type)) {
|
|
309
|
-
// Gateway timeout
|
|
310
|
-
if (error?.response?.statusCode === 504) {
|
|
311
|
-
next({
|
|
312
|
-
...rest,
|
|
313
|
-
error,
|
|
314
|
-
statusCode: error.code,
|
|
315
|
-
connectionRefused: true,
|
|
316
|
-
type: SET_APIERROR,
|
|
252
|
+
api.get('/@wstoken').then((res) => {
|
|
253
|
+
socket = new WebSocket(
|
|
254
|
+
`${settings.apiPath.replace('http', 'ws')}/@ws?ws_token=${
|
|
255
|
+
res.token
|
|
256
|
+
}`,
|
|
257
|
+
);
|
|
258
|
+
socket.onmessage = (message) => {
|
|
259
|
+
const packet = JSON.parse(message.data);
|
|
260
|
+
if (packet.error) {
|
|
261
|
+
dispatch({
|
|
262
|
+
type: `${packet.id}_FAIL`,
|
|
263
|
+
error: packet.error,
|
|
264
|
+
});
|
|
265
|
+
} else {
|
|
266
|
+
dispatch({
|
|
267
|
+
type: `${packet.id}_SUCCESS`,
|
|
268
|
+
result: JSON.parse(packet.data),
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
};
|
|
317
272
|
});
|
|
318
273
|
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
274
|
+
try {
|
|
275
|
+
return next({ ...rest, result, type: `${type}_SUCCESS` });
|
|
276
|
+
} catch (error) {
|
|
277
|
+
// There was an exception while processing reducers or downstream middleware.
|
|
322
278
|
next({
|
|
323
279
|
...rest,
|
|
324
|
-
error,
|
|
325
|
-
|
|
326
|
-
connectionRefused: false,
|
|
327
|
-
type: SET_APIERROR,
|
|
280
|
+
error: { status: 500, error },
|
|
281
|
+
type: `${type}_FAIL`,
|
|
328
282
|
});
|
|
283
|
+
// Rethrow the original exception on the client side only,
|
|
284
|
+
// so it doesn't fall through to express on the server.
|
|
285
|
+
if (__CLIENT__) throw error;
|
|
329
286
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
287
|
+
},
|
|
288
|
+
(error) => {
|
|
289
|
+
// Only SSR can set ECONNREFUSED
|
|
290
|
+
if (error.code === 'ECONNREFUSED') {
|
|
333
291
|
next({
|
|
334
292
|
...rest,
|
|
335
293
|
error,
|
|
336
294
|
statusCode: error.code,
|
|
337
|
-
connectionRefused:
|
|
295
|
+
connectionRefused: true,
|
|
338
296
|
type: SET_APIERROR,
|
|
339
297
|
});
|
|
340
298
|
}
|
|
341
299
|
|
|
342
|
-
//
|
|
343
|
-
else if (error
|
|
300
|
+
// Response error is marked crossDomain if CORS error happen
|
|
301
|
+
else if (error.crossDomain) {
|
|
344
302
|
next({
|
|
345
303
|
...rest,
|
|
346
304
|
error,
|
|
347
|
-
statusCode:
|
|
348
|
-
message: error.response.body.message,
|
|
305
|
+
statusCode: 'CORSERROR',
|
|
349
306
|
connectionRefused: false,
|
|
350
307
|
type: SET_APIERROR,
|
|
351
308
|
});
|
|
352
309
|
}
|
|
353
|
-
}
|
|
354
|
-
return next({ ...rest, error, type: `${type}_FAIL` });
|
|
355
|
-
},
|
|
356
|
-
);
|
|
357
|
-
}
|
|
358
310
|
|
|
359
|
-
|
|
360
|
-
|
|
311
|
+
// Check for actions who can raise api errors
|
|
312
|
+
if (settings.actions_raising_api_errors.includes(action.type)) {
|
|
313
|
+
// Gateway timeout
|
|
314
|
+
if (error?.response?.statusCode === 504) {
|
|
315
|
+
next({
|
|
316
|
+
...rest,
|
|
317
|
+
error,
|
|
318
|
+
statusCode: error.code,
|
|
319
|
+
connectionRefused: true,
|
|
320
|
+
type: SET_APIERROR,
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// Redirect
|
|
325
|
+
else if (error?.code === 301) {
|
|
326
|
+
next({
|
|
327
|
+
...rest,
|
|
328
|
+
error,
|
|
329
|
+
statusCode: error.code,
|
|
330
|
+
connectionRefused: false,
|
|
331
|
+
type: SET_APIERROR,
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// Redirect
|
|
336
|
+
else if (error?.code === 408) {
|
|
337
|
+
next({
|
|
338
|
+
...rest,
|
|
339
|
+
error,
|
|
340
|
+
statusCode: error.code,
|
|
341
|
+
connectionRefused: false,
|
|
342
|
+
type: SET_APIERROR,
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
// Unauthorized
|
|
347
|
+
else if (error?.response?.statusCode === 401) {
|
|
348
|
+
next({
|
|
349
|
+
...rest,
|
|
350
|
+
error,
|
|
351
|
+
statusCode: error.response,
|
|
352
|
+
message: error.response.body.message,
|
|
353
|
+
connectionRefused: false,
|
|
354
|
+
type: SET_APIERROR,
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
return next({ ...rest, error, type: `${type}_FAIL` });
|
|
359
|
+
},
|
|
360
|
+
);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
return actionPromise;
|
|
364
|
+
};
|
|
361
365
|
|
|
362
366
|
export default apiMiddlewareFactory;
|
|
@@ -5,43 +5,45 @@
|
|
|
5
5
|
import config from '@plone/volto/registry';
|
|
6
6
|
import { matchPath } from 'react-router';
|
|
7
7
|
|
|
8
|
-
const blacklistRoutes =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
let { pathname } = action.payload.location;
|
|
16
|
-
const { externalRoutes = [] } = config.settings;
|
|
8
|
+
const blacklistRoutes =
|
|
9
|
+
({ dispatch, getState }) =>
|
|
10
|
+
(next) =>
|
|
11
|
+
(action) => {
|
|
12
|
+
if (typeof action === 'function') {
|
|
13
|
+
return next(action);
|
|
14
|
+
}
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
switch (action.type) {
|
|
17
|
+
case '@@router/LOCATION_CHANGE':
|
|
18
|
+
let { pathname } = action.payload.location;
|
|
19
|
+
const { externalRoutes = [] } = config.settings;
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
actionToSend.payload.location.pathname = actionToSend.payload.location.pathname.substring(
|
|
25
|
-
8,
|
|
21
|
+
const route = externalRoutes.find((route) =>
|
|
22
|
+
matchPath(pathname, route.match),
|
|
26
23
|
);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (
|
|
30
|
-
|
|
24
|
+
|
|
25
|
+
let actionToSend = action;
|
|
26
|
+
if (pathname.startsWith('/++api++')) {
|
|
27
|
+
actionToSend.payload.location.pathname =
|
|
28
|
+
actionToSend.payload.location.pathname.substring(8);
|
|
29
|
+
// To handle the `window.location.replace`
|
|
30
|
+
pathname = actionToSend.payload.location.pathname;
|
|
31
|
+
if (window.history) {
|
|
32
|
+
window.history.replaceState(window.history.state, '', pathname);
|
|
33
|
+
}
|
|
31
34
|
}
|
|
32
|
-
}
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
};
|
|
36
|
+
if (!route) {
|
|
37
|
+
return next(actionToSend);
|
|
38
|
+
} else {
|
|
39
|
+
window.location.replace(
|
|
40
|
+
route.url ? route.url(actionToSend.payload) : pathname,
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
break;
|
|
44
|
+
default:
|
|
45
|
+
return next(action);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
46
48
|
|
|
47
|
-
export default blacklistRoutes;
|
|
49
|
+
export default blacklistRoutes;
|
package/src/helpers/dates.js
CHANGED
|
@@ -11,8 +11,8 @@ export const viewDate = (locale, value, format) => {
|
|
|
11
11
|
? // Since we assume UTC everywhere, then transform to local (momentjs default)
|
|
12
12
|
moment(value)
|
|
13
13
|
: value.match(/T(.)/g)
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
? moment(`${value}Z`) // This might happen in old Plone versions dates
|
|
15
|
+
: moment(value); //This when date is like '2021-05-05'
|
|
16
16
|
} else {
|
|
17
17
|
datetime = moment(value);
|
|
18
18
|
}
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
line-height: 17px;
|
|
49
49
|
outline: none;
|
|
50
50
|
vertical-align: baseline;
|
|
51
|
+
|
|
51
52
|
input:focus ~ label::before {
|
|
52
53
|
box-shadow: $gdpr-focus-shadow !important;
|
|
53
54
|
outline: none !important;
|
|
@@ -63,8 +64,11 @@
|
|
|
63
64
|
left: 0;
|
|
64
65
|
border: 1px solid $gdpr-toggle-border;
|
|
65
66
|
background-color: $gdpr-toggle;
|
|
66
|
-
transition:
|
|
67
|
-
|
|
67
|
+
transition:
|
|
68
|
+
border 0.1s ease,
|
|
69
|
+
opacity 0.1s ease,
|
|
70
|
+
transform 0.1s ease,
|
|
71
|
+
box-shadow 0.1s ease;
|
|
68
72
|
}
|
|
69
73
|
|
|
70
74
|
&:after {
|
|
@@ -151,12 +155,14 @@
|
|
|
151
155
|
width: 1.5rem;
|
|
152
156
|
height: 1.5rem;
|
|
153
157
|
border: 1.5px solid $gdpr-toggle-border;
|
|
158
|
+
border-radius: 500rem;
|
|
154
159
|
background: #ffffff
|
|
155
160
|
linear-gradient(transparent, rgba(0, 0, 0, 0.05));
|
|
156
|
-
border-radius: 500rem;
|
|
157
161
|
content: '' !important;
|
|
158
162
|
opacity: 1;
|
|
159
|
-
transition:
|
|
163
|
+
transition:
|
|
164
|
+
background 0.3s ease,
|
|
165
|
+
left 0.3s ease;
|
|
160
166
|
}
|
|
161
167
|
}
|
|
162
168
|
}
|
|
@@ -197,8 +203,8 @@
|
|
|
197
203
|
}
|
|
198
204
|
|
|
199
205
|
button.gdpr-privacy-show-banner {
|
|
200
|
-
margin: 0;
|
|
201
206
|
border-radius: 0;
|
|
207
|
+
margin: 0;
|
|
202
208
|
border-bottom-left-radius: 5px;
|
|
203
209
|
border-top-left-radius: 5px;
|
|
204
210
|
}
|
|
@@ -233,6 +239,7 @@ body.has-toolbar-collapsed {
|
|
|
233
239
|
}
|
|
234
240
|
}
|
|
235
241
|
}
|
|
242
|
+
|
|
236
243
|
.gdpr-privacy-banner
|
|
237
244
|
.gdpr-privacy-content-wrapper
|
|
238
245
|
.gdpr-privacy-content
|
|
@@ -38,6 +38,7 @@ $accordion-icon-color: #7fb2e5;
|
|
|
38
38
|
top: -7px;
|
|
39
39
|
right: 0;
|
|
40
40
|
left: unset;
|
|
41
|
+
|
|
41
42
|
&:focus {
|
|
42
43
|
outline: 1px solid $focus-outline-color;
|
|
43
44
|
}
|
|
@@ -63,6 +64,7 @@ $accordion-icon-color: #7fb2e5;
|
|
|
63
64
|
padding: 0 0.4em;
|
|
64
65
|
border: none;
|
|
65
66
|
background: none;
|
|
67
|
+
|
|
66
68
|
&:focus {
|
|
67
69
|
outline: 1px solid $focus-outline-color;
|
|
68
70
|
}
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
.card-body {
|
|
19
19
|
display: flex;
|
|
20
20
|
flex-direction: column;
|
|
21
|
+
justify-content: space-between;
|
|
21
22
|
padding: 2.5rem;
|
|
22
23
|
padding-bottom: 0rem;
|
|
23
24
|
}
|
|
@@ -50,9 +51,13 @@
|
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
// tablet
|
|
53
|
-
@media (
|
|
54
|
+
@media (min-width: 586px) and (max-width: 1367px) {
|
|
54
55
|
.bandi-in-evidence-cards-wrapper {
|
|
55
56
|
grid-template-columns: auto auto;
|
|
57
|
+
|
|
58
|
+
div.read-more a.read-more {
|
|
59
|
+
flex-direction: row;
|
|
60
|
+
}
|
|
56
61
|
}
|
|
57
62
|
}
|
|
58
63
|
|