Skip to content

Commit

Permalink
chore: make feature-search components standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
jahow committed Nov 21, 2024
1 parent 85909a9 commit b7f61e7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ describe('FavoriteStarComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [FavoriteStarComponent, StarToggleComponent],
imports: [TranslateModule.forRoot()],
imports: [
TranslateModule.forRoot(),
FavoriteStarComponent,
StarToggleComponent,
],
providers: [
{
provide: PlatformServiceInterface,
Expand Down Expand Up @@ -66,7 +69,7 @@ describe('FavoriteStarComponent', () => {
favoritesService = TestBed.inject(FavoritesService)
fixture = TestBed.createComponent(FavoriteStarComponent)
component = fixture.componentInstance
component.displayCount = 'true'
component.displayCount = true
fixture.detectChanges()
starToggle = fixture.debugElement.query(
By.directive(StarToggleComponent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ import { Observable, Subscription } from 'rxjs'
import { CatalogRecord } from '@geonetwork-ui/common/domain/model/record'
import { AuthService, FavoritesService } from '@geonetwork-ui/api/repository'
import { PlatformServiceInterface } from '@geonetwork-ui/common/domain/platform.service.interface'
import { CommonModule } from '@angular/common'

@Component({
selector: 'gn-ui-favorite-star',
templateUrl: './favorite-star.component.html',
styleUrls: ['./favorite-star.component.css'],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [CommonModule, StarToggleComponent],
})
export class FavoriteStarComponent implements AfterViewInit, OnDestroy {
@Input() displayCount? = true
Expand Down
3 changes: 0 additions & 3 deletions libs/feature/search/src/lib/feature-search.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { SearchStateContainerDirective } from './state/container/search-state.co
import { AutocompleteComponent, UiInputsModule } from '@geonetwork-ui/ui/inputs'
import { NgModule } from '@angular/core'
import { UiElementsModule } from '@geonetwork-ui/ui/elements'
import { FavoriteStarComponent } from './favorites/favorite-star/favorite-star.component'
import { FilterDropdownComponent } from './filter-dropdown/filter-dropdown.component'
import { UiWidgetsModule } from '@geonetwork-ui/ui/widgets'
import { RecordsRepositoryInterface } from '@geonetwork-ui/common/domain/repository/records-repository.interface'
Expand All @@ -32,7 +31,6 @@ import { Gn4Repository } from '@geonetwork-ui/api/repository'
ResultsListContainerComponent,
ResultsHitsContainerComponent,
SearchStateContainerDirective,
FavoriteStarComponent,
FilterDropdownComponent,
],
imports: [
Expand Down Expand Up @@ -60,7 +58,6 @@ import { Gn4Repository } from '@geonetwork-ui/api/repository'
ResultsHitsContainerComponent,
FacetsModule,
SearchStateContainerDirective,
FavoriteStarComponent,
FilterDropdownComponent,
],
providers: [
Expand Down

0 comments on commit b7f61e7

Please sign in to comment.