Skip to content

Commit

Permalink
feat: apply empty data at user select dropdown
Browse files Browse the repository at this point in the history
Signed-off-by: NaYeong,Kim <[email protected]>
  • Loading branch information
skdud4659 committed Jan 3, 2025
1 parent d545719 commit 2a97a56
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions apps/web/src/common/modules/user/UserSelectDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,21 @@ const menuItemsHandler = (): AutocompleteHandler => async (keyword: string, page
const _totalCount = Number((pageStart - 1 || 0) + pageLimit);
const filterItems = (items: SelectDropdownMenuItem[]) => items.filter((item) => getTextHighlightRegex(keyword).test(item.name)).slice(pageStart - 1, _totalCount);
if (state.allUserItems.length === 0 && state.allUserGroupItems.length === 0) {
return {
results: [],
};
}
if (resultIndex === undefined) {
return state.dropdownCategories.map((c, idx) => {
const items = c.key === 'user' ? state.allUserItems : state.allUserGroupItems;
const _slicedItems = filterItems(items);
if (_slicedItems.length === 0) {
return {
results: [],
};
}
if (props.showCategoryTitle) {
_slicedItems.unshift({ type: 'header', label: c.title, name: 'header' });
}
Expand Down

0 comments on commit 2a97a56

Please sign in to comment.