mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 00:56:02 +00:00
SYNC: fixed translating app object list
This commit is contained in:
committed by
Diflow
parent
43fd7b6000
commit
f642c7570e
@@ -38,19 +38,20 @@
|
||||
|
||||
$: matcher = module.createMatcher && module.createMatcher(filter, passProps?.searchSettings);
|
||||
|
||||
$: dataLabeled = _.compact(
|
||||
(list || []).map(data => {
|
||||
const dataCopy = {...data,
|
||||
group: (data?.group && _.isFunction(data.group)) ? data.group() : data.group,
|
||||
title: (data?.title && _.isFunction(data.title)) ? data.title() : data.title,
|
||||
description: (data?.description && _.isFunction(data.description)) ? data.description() : data.description,
|
||||
args: (data?.args || []).map(x => ({
|
||||
...x,
|
||||
label: (x?.label && _.isFunction(x.label)) ? x.label() : x.label,
|
||||
}))
|
||||
};
|
||||
$: listTranslated = (list || []).map(data => ({
|
||||
...data,
|
||||
group: data?.group && _.isFunction(data.group) ? data.group() : data.group,
|
||||
title: data?.title && _.isFunction(data.title) ? data.title() : data.title,
|
||||
description: data?.description && _.isFunction(data.description) ? data.description() : data.description,
|
||||
args: (data?.args || []).map(x => ({
|
||||
...x,
|
||||
label: x?.label && _.isFunction(x.label) ? x.label() : x.label,
|
||||
})),
|
||||
}));
|
||||
|
||||
const matchResult = matcher ? matcher(dataCopy) : true;
|
||||
$: dataLabeled = _.compact(
|
||||
(listTranslated || []).map(data => {
|
||||
const matchResult = matcher ? matcher(data) : true;
|
||||
|
||||
let isMatched = true;
|
||||
let isMainMatched = true;
|
||||
@@ -72,8 +73,8 @@
|
||||
isChildMatched = !module.disableShowChildrenWithParentMatch;
|
||||
}
|
||||
|
||||
const group = groupFunc ? groupFunc(dataCopy) : undefined;
|
||||
return { group, data: dataCopy, isMatched, isChildMatched, isMainMatched };
|
||||
const group = groupFunc ? groupFunc(data) : undefined;
|
||||
return { group, data, isMatched, isChildMatched, isMainMatched };
|
||||
})
|
||||
);
|
||||
|
||||
@@ -112,7 +113,8 @@
|
||||
|
||||
$: groups = groupFunc ? extendGroups(_.groupBy(dataLabeled, 'group'), emptyGroupNames) : null;
|
||||
|
||||
$: listLimited = isExpandedBySearch && !expandLimited ? filtered.slice(0, filter.trim().length < 3 ? 1 : 3) : list;
|
||||
$: listLimited =
|
||||
isExpandedBySearch && !expandLimited ? filtered.slice(0, filter.trim().length < 3 ? 1 : 3) : listTranslated;
|
||||
$: isListLimited = isExpandedBySearch && listLimited.length < filtered.length;
|
||||
$: listMissingItems = isListLimited ? filtered.slice(listLimited.length) : [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user