mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-03 10:33:58 +00:00
fixed search in list
This commit is contained in:
@@ -21,6 +21,7 @@ Builds:
|
|||||||
- ADDED: Display "No rows" message, quick add new row
|
- ADDED: Display "No rows" message, quick add new row
|
||||||
- ADDED: Choose default database from list
|
- ADDED: Choose default database from list
|
||||||
- ADDED: Default database is automatically selected on connect
|
- ADDED: Default database is automatically selected on connect
|
||||||
|
- ADDED: arm64-only build for Mac
|
||||||
|
|
||||||
### 6.0.0
|
### 6.0.0
|
||||||
- ADDED: Order or filter the indexes for huge tables #922
|
- ADDED: Order or filter the indexes for huge tables #922
|
||||||
|
|||||||
@@ -89,6 +89,7 @@
|
|||||||
{passProps}
|
{passProps}
|
||||||
isExpandedBySearch={filter && item.isChildMatched}
|
isExpandedBySearch={filter && item.isChildMatched}
|
||||||
{filter}
|
{filter}
|
||||||
|
isMainMatched={item.isMainMatched}
|
||||||
/>
|
/>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -40,33 +40,33 @@
|
|||||||
const matchResult = matcher ? matcher(data) : true;
|
const matchResult = matcher ? matcher(data) : true;
|
||||||
|
|
||||||
let isMatched = true;
|
let isMatched = true;
|
||||||
|
let isMainMatched = true;
|
||||||
let isChildMatched = true;
|
let isChildMatched = true;
|
||||||
|
|
||||||
if (matchResult == false) {
|
if (matchResult == false) {
|
||||||
isMatched = false;
|
isMatched = false;
|
||||||
isChildMatched = false;
|
isChildMatched = false;
|
||||||
|
isMainMatched = false;
|
||||||
} else if (matchResult == 'child') {
|
} else if (matchResult == 'child') {
|
||||||
isMatched = true;
|
isMainMatched = false;
|
||||||
isChildMatched = true;
|
|
||||||
} else if (matchResult == 'main') {
|
} else if (matchResult == 'main') {
|
||||||
isMatched = true;
|
|
||||||
isChildMatched = false;
|
isChildMatched = false;
|
||||||
} else if (matchResult == 'none') {
|
} else if (matchResult == 'none') {
|
||||||
isMatched = false;
|
isMatched = false;
|
||||||
isChildMatched = false;
|
isChildMatched = false;
|
||||||
|
isMainMatched = false;
|
||||||
} else if (matchResult == 'both') {
|
} else if (matchResult == 'both') {
|
||||||
isMatched = true;
|
|
||||||
isChildMatched = !module.disableShowChildrenWithParentMatch;
|
isChildMatched = !module.disableShowChildrenWithParentMatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
const group = groupFunc ? groupFunc(data) : undefined;
|
const group = groupFunc ? groupFunc(data) : undefined;
|
||||||
return { group, data, isMatched, isChildMatched };
|
return { group, data, isMatched, isChildMatched, isMainMatched };
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
$: filtered = dataLabeled.filter(x => x.isMatched).map(x => x.data);
|
$: filtered = dataLabeled.filter(x => x.isMatched).map(x => x.data);
|
||||||
|
|
||||||
$: childrenMatched = dataLabeled.filter(x => x.isChildMatched).map(x => x.data);
|
$: childrenMatched = dataLabeled.filter(x => x.isChildMatched).map(x => x.data);
|
||||||
|
$: mainMatched = dataLabeled.filter(x => x.isMainMatched).map(x => x.data);
|
||||||
|
|
||||||
// let filtered = [];
|
// let filtered = [];
|
||||||
|
|
||||||
@@ -136,6 +136,7 @@
|
|||||||
{disableContextMenu}
|
{disableContextMenu}
|
||||||
{filter}
|
{filter}
|
||||||
isExpandedBySearch={filter && childrenMatched.includes(data)}
|
isExpandedBySearch={filter && childrenMatched.includes(data)}
|
||||||
|
isMainMatched={filter && mainMatched.includes(data)}
|
||||||
{passProps}
|
{passProps}
|
||||||
{getIsExpanded}
|
{getIsExpanded}
|
||||||
{setIsExpanded}
|
{setIsExpanded}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
export let passProps;
|
export let passProps;
|
||||||
export let getIsExpanded = null;
|
export let getIsExpanded = null;
|
||||||
export let setIsExpanded = null;
|
export let setIsExpanded = null;
|
||||||
|
export let isMainMatched = false;
|
||||||
|
|
||||||
let isExpandedCore = false;
|
let isExpandedCore = false;
|
||||||
|
|
||||||
@@ -71,6 +72,7 @@
|
|||||||
{passProps}
|
{passProps}
|
||||||
{isExpandedBySearch}
|
{isExpandedBySearch}
|
||||||
{isExpanded}
|
{isExpanded}
|
||||||
|
{isMainMatched}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
export let isExpandedBySearch;
|
export let isExpandedBySearch;
|
||||||
export let isExpanded;
|
export let isExpanded;
|
||||||
|
export let isMainMatched;
|
||||||
|
|
||||||
$: isExpandedOnlyBySearch = isExpandedBySearch && !isExpanded;
|
$: isExpandedOnlyBySearch = isExpandedBySearch && !isExpanded;
|
||||||
|
|
||||||
@@ -26,6 +27,6 @@
|
|||||||
list={_.sortBy(dbList, x => x.sortOrder ?? x.name).map(db => ({ ...db, connection: data }))}
|
list={_.sortBy(dbList, x => x.sortOrder ?? x.name).map(db => ({ ...db, connection: data }))}
|
||||||
module={databaseAppObject}
|
module={databaseAppObject}
|
||||||
{passProps}
|
{passProps}
|
||||||
filter={isExpanded ? '' : filter}
|
filter={isMainMatched ? '' : filter}
|
||||||
{isExpandedBySearch}
|
{isExpandedBySearch}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user