@gridsuite/commons-ui 0.27.0 → 0.27.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.
|
@@ -221,16 +221,21 @@ var TreeViewFinder = function TreeViewFinder(props) {
|
|
|
221
221
|
}, node.name));
|
|
222
222
|
};
|
|
223
223
|
|
|
224
|
+
var showChevron = function showChevron(node) {
|
|
225
|
+
// by defaut show Chevron if childrenCount is null or undefined otherwise only if > 0
|
|
226
|
+
return !!(node.childrenCount == null || node.childrenCount && node.childrenCount > 0);
|
|
227
|
+
};
|
|
228
|
+
|
|
224
229
|
var renderTree = function renderTree(node) {
|
|
225
230
|
if (!node) return;
|
|
226
231
|
return /*#__PURE__*/_react["default"].createElement(_TreeItem["default"], {
|
|
227
232
|
key: node.id,
|
|
228
233
|
nodeId: node.id,
|
|
229
234
|
label: renderTreeItemLabel(node),
|
|
230
|
-
expandIcon: node
|
|
235
|
+
expandIcon: showChevron(node) ? /*#__PURE__*/_react["default"].createElement(_ChevronRight["default"], {
|
|
231
236
|
className: classes.icon
|
|
232
237
|
}) : null,
|
|
233
|
-
collapseIcon: node
|
|
238
|
+
collapseIcon: showChevron(node) ? /*#__PURE__*/_react["default"].createElement(_ExpandMore["default"], {
|
|
234
239
|
className: classes.icon
|
|
235
240
|
}) : null
|
|
236
241
|
}, Array.isArray(node.children) ? node.children.length ? node.children.sort(sortMethod).map(function (child) {
|
package/lib/utils/AuthService.js
CHANGED
|
@@ -199,7 +199,11 @@ function handleSilentRenewCallback(userManagerInstance) {
|
|
|
199
199
|
function handleUser(dispatch, userManager, validateUser) {
|
|
200
200
|
userManager.events.addUserLoaded(function (user) {
|
|
201
201
|
console.debug('user loaded', user);
|
|
202
|
-
dispatchUser(dispatch, userManager, validateUser)
|
|
202
|
+
dispatchUser(dispatch, userManager, validateUser) // The oidc-client-lib doesn't manage errors from this Promise
|
|
203
|
+
// For now we log it to avoid uncaught Promise for good practice.
|
|
204
|
+
["catch"](function (e) {
|
|
205
|
+
console.log('Error in dispatchUser in addUserLoaded event', e);
|
|
206
|
+
});
|
|
203
207
|
});
|
|
204
208
|
userManager.events.addSilentRenewError(function (error) {
|
|
205
209
|
console.debug(error); // wait for accessTokenExpiringNotificationTime so that the user is expired
|
|
@@ -215,6 +219,7 @@ function handleUser(dispatch, userManager, validateUser) {
|
|
|
215
219
|
console.log('Error in silent renew, idtoken expired: ' + idTokenExpiresIn + ' => Logging out.', error); // TODO here allow to continue to use the app but in some kind of frozen state because we can't make API calls anymore
|
|
216
220
|
// remove the user from our app, but don't sso logout on all other apps
|
|
217
221
|
|
|
222
|
+
dispatch((0, _actions.setShowAuthenticationRouterLogin)(true));
|
|
218
223
|
return dispatch((0, _actions.setLoggedUser)(null));
|
|
219
224
|
} else if (userManager.idpSettings.maxExpiresIn) {
|
|
220
225
|
if (idTokenExpiresIn < userManager.idpSettings.maxExpiresIn) {
|