Преглед изворни кода

🔧 fix: filter out empty string group from pricing groups selector (#1365)

Filter out the special empty string group ("": "用户分组") from the
usable groups in PricingGroups component. This empty group represents
"user's current group" but contains no data and should not be displayed
in the group filter options.

- Add filter condition to exclude empty string keys from usableGroup
- Prevents displaying invalid empty group option in UI
- Improves user experience by showing only valid selectable groups
t0ng7u пре 7 месеци
родитељ
комит
8a54512037
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      web/src/components/table/model-pricing/filter/PricingGroups.jsx

+ 1 - 1
web/src/components/table/model-pricing/filter/PricingGroups.jsx

@@ -30,7 +30,7 @@ import SelectableButtonGroup from '../../../common/ui/SelectableButtonGroup';
  * @param {Function} t i18n
  */
 const PricingGroups = ({ filterGroup, setFilterGroup, usableGroup = {}, models = [], loading = false, t }) => {
-  const groups = ['all', ...Object.keys(usableGroup)];
+  const groups = ['all', ...Object.keys(usableGroup).filter(key => key !== '')];
 
   const items = groups.map((g) => {
     let count = 0;