Merge branch 'main' of github.com:ghostfolio/ghostfolio
All checks were successful
Docker image CD / build_and_push (push) Successful in 13m42s
All checks were successful
Docker image CD / build_and_push (push) Successful in 13m42s
This commit is contained in:
@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Introduced fuzzy search for the quick links of the assistant
|
||||
- Improved the search results of the assistant to only display categories with content
|
||||
- Renamed `Account` to `account` in the `Order` database schema
|
||||
- Improved the language localization for German (`de`)
|
||||
|
@ -41,6 +41,7 @@ import { MatSelectModule } from '@angular/material/select';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { Account, AssetClass, DataSource } from '@prisma/client';
|
||||
import { differenceInYears } from 'date-fns';
|
||||
import Fuse from 'fuse.js';
|
||||
import { isFunction } from 'lodash';
|
||||
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
|
||||
import { EMPTY, Observable, Subject, merge, of } from 'rxjs';
|
||||
@ -642,20 +643,18 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit {
|
||||
return acc;
|
||||
}, [] as IRoute[]);
|
||||
|
||||
return allRoutes
|
||||
.filter(({ title }) => {
|
||||
return title.toLowerCase().includes(searchTerm);
|
||||
})
|
||||
.map(({ routerLink, title }) => {
|
||||
return {
|
||||
routerLink,
|
||||
mode: SearchMode.QUICK_LINK as const,
|
||||
name: title
|
||||
};
|
||||
})
|
||||
.sort((a, b) => {
|
||||
return a.name.localeCompare(b.name);
|
||||
});
|
||||
const fuse = new Fuse(allRoutes, {
|
||||
keys: ['title'],
|
||||
threshold: 0.3
|
||||
});
|
||||
|
||||
return fuse.search(searchTerm).map(({ item: { routerLink, title } }) => {
|
||||
return {
|
||||
routerLink,
|
||||
mode: SearchMode.QUICK_LINK as const,
|
||||
name: title
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
private setFilterFormValues() {
|
||||
|
10
package-lock.json
generated
10
package-lock.json
generated
@ -66,6 +66,7 @@
|
||||
"countup.js": "2.8.2",
|
||||
"date-fns": "4.1.0",
|
||||
"envalid": "8.0.0",
|
||||
"fuse.js": "7.1.0",
|
||||
"google-spreadsheet": "3.2.0",
|
||||
"helmet": "7.0.0",
|
||||
"http-status-codes": "2.3.0",
|
||||
@ -20615,6 +20616,15 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/fuse.js": {
|
||||
"version": "7.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-7.1.0.tgz",
|
||||
"integrity": "sha512-trLf4SzuuUxfusZADLINj+dE8clK1frKdmqiJNb1Es75fmI5oY6X2mxLVUciLLjxqw/xr72Dhy+lER6dGd02FQ==",
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/gaxios": {
|
||||
"version": "4.3.3",
|
||||
"resolved": "https://registry.npmjs.org/gaxios/-/gaxios-4.3.3.tgz",
|
||||
|
@ -112,6 +112,7 @@
|
||||
"countup.js": "2.8.2",
|
||||
"date-fns": "4.1.0",
|
||||
"envalid": "8.0.0",
|
||||
"fuse.js": "7.1.0",
|
||||
"google-spreadsheet": "3.2.0",
|
||||
"helmet": "7.0.0",
|
||||
"http-status-codes": "2.3.0",
|
||||
|
Reference in New Issue
Block a user