Skip to content

Commit 27bc297

Browse files
committed
add ratio condition
1 parent 53e6e33 commit 27bc297

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/components/SelectorComponents/Cascading/MenuListsDropdown.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,10 @@ export const MenuListsDropdown = () => {
230230
isPercentParam?: boolean,
231231
) => {
232232
const { value, type, label } = event.currentTarget.dataset;
233-
const isPercent = value?.includes('percentage') || isPercentParam;
233+
const isPercent =
234+
value?.includes('percentage') ||
235+
value?.includes('_ratio') ||
236+
isPercentParam;
234237
event.stopPropagation();
235238
setIsClickMenu(!isClickMenu);
236239
let opsValue = '';
@@ -534,7 +537,8 @@ export const MenuListsDropdown = () => {
534537
if (Array.isArray(nodes!)) {
535538
return nodes.map((node: FilterMenu | ChildrenFilter, index: number) => {
536539
const { children, var_name, type, label: nodeLabel, ops, roles } = node;
537-
const isPercent = var_name?.includes('percentage');
540+
const isPercent =
541+
var_name?.includes('percentage') || var_name?.includes('_ratio');
538542
const hasChildren = children && children.length >= 1;
539543
const menuLabel = (nodeLabel as LabelFilterMeneList)[languageValue];
540544
const uniqueKey = `${menuLabel} - ${index}`;
@@ -584,7 +588,8 @@ export const MenuListsDropdown = () => {
584588
const { children, var_name, type, label: nodeLabel, ops, roles } = node;
585589
const menuLabel = (nodeLabel as LabelFilterMeneList)[languageValue];
586590
const hasChildren = children && children.length >= 1;
587-
const isPercent = var_name?.includes('percentage');
591+
const isPercent =
592+
var_name?.includes('percentage') || var_name?.includes('_ratio');
588593

589594
if (hasChildren) {
590595
return {
@@ -786,7 +791,8 @@ export const MenuListsDropdown = () => {
786791
{filterMenu.map(
787792
(item: FilterMenuList | ChildrenFilter, index: number) => {
788793
const { var_name, label, type, ops, roles } = item;
789-
const isPercent = var_name?.includes('percentage');
794+
const isPercent =
795+
var_name?.includes('percentage') || var_name?.includes('_ratio');
790796
const itemLabel = (label as LabelFilterMeneList)[languageValue];
791797
return var_name ? (
792798
<Button

0 commit comments

Comments
 (0)