Skip to content

Commit

Permalink
Merge pull request #800 from geonetwork/dropdown-types
Browse files Browse the repository at this point in the history
UI inputs: Fix typings
  • Loading branch information
tkohr committed Feb 22, 2024
2 parents 34bd985 + eee3946 commit 7a59af6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class FavoriteStarComponent implements AfterViewInit, OnDestroy {
map((favorites) => favorites.indexOf(this.record.uniqueIdentifier) > -1)
)
isAnonymous$ = this.platformService.isAnonymous()
record_: CatalogRecord
record_: Partial<CatalogRecord>
favoriteCount: number | null
loading = false
loginUrl = this.authService.loginUrl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { catchError, filter, map, startWith } from 'rxjs/operators'
import { SearchFacade } from '../state/search.facade'
import { SearchService } from '../utils/service/search.service'
import { FieldsService } from '../utils/service/fields.service'
import { FieldAvailableValue } from '../utils/service/fields'
import { FieldAvailableValue, FieldValue } from '../utils/service/fields'

@Component({
selector: 'gn-ui-filter-dropdown',
Expand All @@ -31,11 +31,11 @@ export class FilterDropdownComponent implements OnInit {
filter((selected) => !!selected),
startWith([]),
catchError(() => of([]))
)
) as Observable<FieldValue[]>

onSelectedValues(values: (string | number)[]) {
onSelectedValues(values: unknown[]) {
this.fieldsService
.buildFiltersFromFieldValues({ [this.fieldName]: values })
.buildFiltersFromFieldValues({ [this.fieldName]: values as FieldValue[] })
.subscribe((filters) => this.searchService.updateFilters(filters))
}

Expand Down
1 change: 1 addition & 0 deletions libs/ui/inputs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ export * from './lib/viewport-intersector/viewport-intersector.component'
export * from './lib/checkbox/checkbox.component'
export * from './lib/search-input/search-input.component'
export * from './lib/date-range-picker/date-range-picker.component'
export * from './lib/editable-label/editable-label.directive'
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[placeholder]="placeholder"
[formControl]="control"
[matAutocomplete]="auto"
(keyup.enter)="handleEnter($event.target.value)"
(keyup.enter)="handleEnter(searchInput.value)"
/>
<button
type="button"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
type="checkbox"
#checkBox
[checked]="isSelected(choice)"
(change)="select(choice, $event.target.checked)"
(change)="select(choice, checkBox.checked)"
/>
<span class="ml-[8px] text-[14px] truncate">
{{ choice.label }}
Expand Down

0 comments on commit 7a59af6

Please sign in to comment.