Skip to content

Commit

Permalink
fix(date-range): define and export type once
Browse files Browse the repository at this point in the history
  • Loading branch information
tkohr committed Nov 6, 2024
1 parent 0986c70 commit 873cbff
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
7 changes: 2 additions & 5 deletions libs/feature/router/src/lib/default/constants.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import {
DateRange,
FieldsService,
FieldValue,
} from '@geonetwork-ui/feature/search'
import { DateRange } from '@geonetwork-ui/api/repository'
// import { FieldsService, FieldValue } from '@geonetwork-ui/feature/search'

export const ROUTER_STATE_KEY = 'router'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { isDateRange } from '@geonetwork-ui/api/repository'
import { DateRange, isDateRange } from '@geonetwork-ui/api/repository'
import { ROUTE_PARAMS, SearchRouteParams } from '../constants'
import { DateRange } from '@geonetwork-ui/feature/search'

export function flattenQueryParams(
params: SearchRouteParams
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import { SearchFacade } from '../state/search.facade'
import { SearchService } from '../utils/service/search.service'
import { FieldsService } from '../utils/service/fields.service'
import {
DateRange,
FieldAvailableValue,
FieldType,
FieldValue,
} from '../utils/service/fields'
import { DateRange } from '@geonetwork-ui/api/repository'

@Component({
selector: 'gn-ui-filter-dropdown',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Injectable, Injector } from '@angular/core'
import {
AbstractSearchField,
DateRange,
DateRangeSearchField,
FieldValue,
FullTextSearchField,
Expand All @@ -18,6 +17,7 @@ import { forkJoin, Observable, of } from 'rxjs'
import { map } from 'rxjs/operators'
import { FieldFilters } from '@geonetwork-ui/common/domain/model/search'
import { marker } from '@biesbjerg/ngx-translate-extract-marker'
import { DateRange } from '@geonetwork-ui/api/repository'

// key is the field name
export type FieldValues = Record<string, FieldValue[] | FieldValue | DateRange>
Expand Down
2 changes: 1 addition & 1 deletion libs/feature/search/src/lib/utils/service/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import {
TermBucket,
} from '@geonetwork-ui/common/domain/model/search'
import {
DateRange,
ElasticsearchService,
isDateRange,
METADATA_LANGUAGE,
} from '@geonetwork-ui/api/repository'
import { LangService } from '@geonetwork-ui/util/i18n'

export type DateRange = { start?: Date; end?: Date }
export type FieldType = 'values' | 'dateRange'

export type FieldValue = string | number
Expand Down

0 comments on commit 873cbff

Please sign in to comment.