Browse Source

Task/randomize placeholder in assistant (#6889)

* Randomize placeholder

* Update changelog
pull/6809/head
Thomas Kaul 7 days ago
committed by GitHub
parent
commit
875a39df4a
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 20
      libs/ui/src/lib/assistant/assistant.component.ts

1
CHANGELOG.md

@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Improved the pagination in the activities table of the holding detail dialog
- Randomized the placeholder in the assistant
- Enabled the _Bull Dashboard_ in the admin control panel without requiring an environment variable (experimental)
- Extracted the page tabs to a reusable component
- Upgraded `bull-board` from version `7.0.0` to `7.1.5`

20
libs/ui/src/lib/assistant/assistant.component.ts

@ -40,7 +40,7 @@ import {
closeOutline,
searchOutline
} from 'ionicons/icons';
import { isFunction } from 'lodash';
import { isFunction, sample } from 'lodash';
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
import { EMPTY, Observable, merge, of } from 'rxjs';
import {
@ -106,14 +106,17 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit {
public dateRangeFormControl = new FormControl<string | null>(null);
public dateRangeOptions: DateRangeOption[] = [];
public holdings: PortfolioPosition[] = [];
public isLoading = {
accounts: false,
assetProfiles: false,
holdings: false,
quickLinks: false
};
public isOpen = false;
public placeholder = $localize`Find account, holding or page...`;
public placeholder: string;
public portfolioFilterFormControl = new FormControl<PortfolioFilterFormValue>(
{
account: null,
@ -122,13 +125,16 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit {
tag: null
}
);
public searchFormControl = new FormControl('');
public searchResults: SearchResults = {
accounts: [],
assetProfiles: [],
holdings: [],
quickLinks: []
};
public tags: Filter[] = [];
protected readonly closed = output<void>();
@ -458,7 +464,15 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit {
holdings: true,
quickLinks: true
};
this.keyManager = new FocusKeyManager(this.assistantListItems).withWrap();
this.placeholder = sample([
$localize`Find an account...`,
$localize`Find a holding...`,
$localize`Jump to a page...`
]);
this.searchResults = {
accounts: [],
assetProfiles: [],
@ -471,6 +485,7 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit {
}
this.searchFormControl.setValue('');
setTimeout(() => {
this.searchElement?.nativeElement?.focus();
});
@ -481,6 +496,7 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit {
holdings: false,
quickLinks: false
};
this.setIsOpen(true);
this.dataService

Loading…
Cancel
Save