diff --git a/CHANGELOG.md b/CHANGELOG.md index fcf3b328b..fa300d212 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Added support to search for a holding by `isin`, `name` and `symbol` (experimental) - Added support for notes in the activities import - Added support to search in the platform selector of the create or update account dialog - Added support for a search query in the portfolio position endpoint diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts index 6a60b5e6a..de366908f 100644 --- a/apps/api/src/app/portfolio/portfolio.service.ts +++ b/apps/api/src/app/portfolio/portfolio.service.ts @@ -1076,7 +1076,8 @@ export class PortfolioService { return ( enhancedSymbolProfile.isin?.toLowerCase().startsWith(searchQuery) || - enhancedSymbolProfile.name?.toLowerCase().startsWith(searchQuery) + enhancedSymbolProfile.name?.toLowerCase().startsWith(searchQuery) || + enhancedSymbolProfile.symbol?.toLowerCase().startsWith(searchQuery) ); }); } diff --git a/apps/api/src/app/user/user.service.ts b/apps/api/src/app/user/user.service.ts index a2710bfd5..a176c43f3 100644 --- a/apps/api/src/app/user/user.service.ts +++ b/apps/api/src/app/user/user.service.ts @@ -163,6 +163,13 @@ export class UserService { let currentPermissions = getPermissions(user.role); + if (!(user.Settings.settings as UserSettings).isExperimentalFeatures) { + currentPermissions = without( + currentPermissions, + permissions.accessAssistant + ); + } + if (this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION')) { user.subscription = this.subscriptionService.getSubscription(Subscription); diff --git a/apps/client/src/app/app.component.html b/apps/client/src/app/app.component.html index 76ccd3ed4..a52261969 100644 --- a/apps/client/src/app/app.component.html +++ b/apps/client/src/app/app.component.html @@ -32,6 +32,7 @@ About +
  • + + + + +
  • + + +
    +
    +
    Holdings
    + + + +
    No entries...
    +
    +
    +
    + diff --git a/libs/ui/src/lib/assistant/assistant.module.ts b/libs/ui/src/lib/assistant/assistant.module.ts new file mode 100644 index 000000000..e4f48e8f3 --- /dev/null +++ b/libs/ui/src/lib/assistant/assistant.module.ts @@ -0,0 +1,25 @@ +import { CommonModule } from '@angular/common'; +import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { RouterModule } from '@angular/router'; +import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; + +import { GfAssistantListItemModule } from './assistant-list-item/assistant-list-item.module'; +import { AssistantComponent } from './assistant.component'; + +@NgModule({ + declarations: [AssistantComponent], + exports: [AssistantComponent], + imports: [ + CommonModule, + FormsModule, + GfAssistantListItemModule, + MatButtonModule, + NgxSkeletonLoaderModule, + ReactiveFormsModule, + RouterModule + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}) +export class GfAssistantModule {} diff --git a/libs/ui/src/lib/assistant/assistant.scss b/libs/ui/src/lib/assistant/assistant.scss new file mode 100644 index 000000000..3339009d4 --- /dev/null +++ b/libs/ui/src/lib/assistant/assistant.scss @@ -0,0 +1,37 @@ +:host { + display: block; + + .result-container { + max-height: 15rem; + } + + .search-container { + border-bottom: 1px solid rgba(var(--dark-dividers)); + height: 2.5rem; + + input { + background: transparent; + outline: 0; + } + + .hot-key-hint { + border: 1px solid rgba(var(--dark-dividers)); + border-radius: 0.25rem; + cursor: default; + } + } +} + +:host-context(.is-dark-theme) { + .search-container { + border-color: rgba(var(--light-dividers)); + + input { + color: rgba(var(--light-primary-text)); + } + + .hot-key-hint { + border-color: rgba(var(--light-dividers)); + } + } +} diff --git a/libs/ui/src/lib/assistant/index.ts b/libs/ui/src/lib/assistant/index.ts new file mode 100644 index 000000000..f58d1b2f3 --- /dev/null +++ b/libs/ui/src/lib/assistant/index.ts @@ -0,0 +1 @@ +export * from './assistant.module'; diff --git a/libs/ui/src/lib/assistant/interfaces/interfaces.ts b/libs/ui/src/lib/assistant/interfaces/interfaces.ts new file mode 100644 index 000000000..922091fb5 --- /dev/null +++ b/libs/ui/src/lib/assistant/interfaces/interfaces.ts @@ -0,0 +1,5 @@ +import { Position } from '@ghostfolio/common/interfaces'; + +export interface ISearchResults { + holdings: Position[]; +}