From 5f845b86888f6d7c6d9bdc042b7d3e559e8105ec Mon Sep 17 00:00:00 2001 From: Shivanshu Ranjan <116422972+Shibbu264@users.noreply.github.com> Date: Tue, 28 Nov 2023 04:35:49 +0530 Subject: [PATCH] changed toNumber to parseFloat #5447 (#5448) Co-authored-by: Steve Piercy --- news/5448.bugfix | 1 + .../Controlpanels/Users/UserGroupMembershipControlPanel.jsx | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 news/5448.bugfix diff --git a/news/5448.bugfix b/news/5448.bugfix new file mode 100644 index 0000000000..0420717612 --- /dev/null +++ b/news/5448.bugfix @@ -0,0 +1 @@ +Replaced `toNumber` with `parseFloat` to avoid an error when validating the `plone.restapi` version. @shibbu264 \ No newline at end of file diff --git a/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.jsx b/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.jsx index 1bec237e41..6195610e7f 100644 --- a/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.jsx +++ b/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.jsx @@ -3,7 +3,7 @@ * TODO Enrich with features of user control panel. Then replace user control panel. */ import React, { useEffect } from 'react'; -import { find, toNumber } from 'lodash'; +import { find } from 'lodash'; import { Portal } from 'react-portal'; import { useHistory } from 'react-router'; import { Link, useLocation } from 'react-router-dom'; @@ -38,7 +38,7 @@ const UserGroupMembershipPanel = () => { (state) => state.controlpanels.systeminformation, ); const can_use_group_membership_panel = systeminformation - ? toNumber(systeminformation?.plone_restapi_version.slice(0, 4)) >= 8.24 + ? parseFloat(systeminformation?.plone_restapi_version.slice(0, 4)) >= 8.24 : false; const actions = useSelector((state) => state.actions?.actions ?? {}); const ploneSetupAction = find(actions.user, {