Merge branch 'main' of github.com:ghostfolio/ghostfolio
All checks were successful
Docker image CD / build_and_push (push) Successful in 13m42s

This commit is contained in:
2025-06-29 06:00:24 -07:00
4 changed files with 25 additions and 14 deletions

View File

@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Introduced fuzzy search for the quick links of the assistant
- Improved the search results of the assistant to only display categories with content - Improved the search results of the assistant to only display categories with content
- Renamed `Account` to `account` in the `Order` database schema - Renamed `Account` to `account` in the `Order` database schema
- Improved the language localization for German (`de`) - Improved the language localization for German (`de`)

View File

@ -41,6 +41,7 @@ import { MatSelectModule } from '@angular/material/select';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
import { Account, AssetClass, DataSource } from '@prisma/client'; import { Account, AssetClass, DataSource } from '@prisma/client';
import { differenceInYears } from 'date-fns'; import { differenceInYears } from 'date-fns';
import Fuse from 'fuse.js';
import { isFunction } from 'lodash'; import { isFunction } from 'lodash';
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
import { EMPTY, Observable, Subject, merge, of } from 'rxjs'; import { EMPTY, Observable, Subject, merge, of } from 'rxjs';
@ -642,20 +643,18 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit {
return acc; return acc;
}, [] as IRoute[]); }, [] as IRoute[]);
return allRoutes const fuse = new Fuse(allRoutes, {
.filter(({ title }) => { keys: ['title'],
return title.toLowerCase().includes(searchTerm); threshold: 0.3
}) });
.map(({ routerLink, title }) => {
return { return fuse.search(searchTerm).map(({ item: { routerLink, title } }) => {
routerLink, return {
mode: SearchMode.QUICK_LINK as const, routerLink,
name: title mode: SearchMode.QUICK_LINK as const,
}; name: title
}) };
.sort((a, b) => { });
return a.name.localeCompare(b.name);
});
} }
private setFilterFormValues() { private setFilterFormValues() {

10
package-lock.json generated
View File

@ -66,6 +66,7 @@
"countup.js": "2.8.2", "countup.js": "2.8.2",
"date-fns": "4.1.0", "date-fns": "4.1.0",
"envalid": "8.0.0", "envalid": "8.0.0",
"fuse.js": "7.1.0",
"google-spreadsheet": "3.2.0", "google-spreadsheet": "3.2.0",
"helmet": "7.0.0", "helmet": "7.0.0",
"http-status-codes": "2.3.0", "http-status-codes": "2.3.0",
@ -20615,6 +20616,15 @@
"url": "https://github.com/sponsors/ljharb" "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": { "node_modules/gaxios": {
"version": "4.3.3", "version": "4.3.3",
"resolved": "https://registry.npmjs.org/gaxios/-/gaxios-4.3.3.tgz", "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-4.3.3.tgz",

View File

@ -112,6 +112,7 @@
"countup.js": "2.8.2", "countup.js": "2.8.2",
"date-fns": "4.1.0", "date-fns": "4.1.0",
"envalid": "8.0.0", "envalid": "8.0.0",
"fuse.js": "7.1.0",
"google-spreadsheet": "3.2.0", "google-spreadsheet": "3.2.0",
"helmet": "7.0.0", "helmet": "7.0.0",
"http-status-codes": "2.3.0", "http-status-codes": "2.3.0",