Skip to content

Commit

Permalink
chore(my-records): remove unused search logic
Browse files Browse the repository at this point in the history
  • Loading branch information
tkohr committed Dec 20, 2024
1 parent e4c83e2 commit 183e6a5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
<main class="bg-white overflow-y-auto">
<div class="flex flex-row items-baseline gap-[8px] px-[32px] py-[20px]">
<ng-container *ngIf="searchText$ | async as searchText; else myRecords">
<h1
class="text-[16px] text-main font-bold"
translate
[translateParams]="{ searchText: searchText }"
>
dashboard.records.search
</h1>
<div class="text-[12px]">
<md-editor-records-count></md-editor-records-count>
</div>
</ng-container>
<ng-template #myRecords>
<ng-container *ngIf="searchFacade.searchFilters$ | async">
<h1 class="text-[16px] text-main font-bold" translate>
dashboard.records.myRecords
</h1>
<div class="text-[12px]">
<md-editor-records-count></md-editor-records-count>
</div>
</ng-template>
</ng-container>
</div>
<div
class="flex flex-row items-center mx-[32px] my-[16px] py-[8px] gap-[16px]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,5 @@ describe('MyRecordsComponent', () => {
owner: user.id,
})
})

it('should map search filters to searchText$', (done) => {
component.searchText$.subscribe((text) => {
expect(text).toBe('hello world')
done()
})
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import { TemplatePortal } from '@angular/cdk/portal'
import { RecordsCountComponent } from '../records-count/records-count.component'
import { ButtonComponent } from '@geonetwork-ui/ui/inputs'
import { ImportRecordComponent } from '@geonetwork-ui/feature/editor'
import { SearchHeaderComponent } from '../../dashboard/search-header/search-header.component'
import { map, Observable } from 'rxjs'
import { SearchFiltersComponent } from '../../dashboard/search-filters/search-filters.component'
import {
NgIconComponent,
Expand Down Expand Up @@ -54,7 +52,6 @@ const FILTER_OWNER = 'owner'
ButtonComponent,
ImportRecordComponent,
FeatureSearchModule,
SearchHeaderComponent,
SearchFiltersComponent,
NgIconComponent,
],
Expand All @@ -76,7 +73,6 @@ export class MyRecordsComponent implements OnInit {
@ViewChild('template') template!: TemplateRef<any>
private overlayRef!: OverlayRef
searchFields = ['changeDate']
searchText$: Observable<string | null>

isImportMenuOpen = false

Expand All @@ -100,10 +96,6 @@ export class MyRecordsComponent implements OnInit {
this.searchFacade.updateFilters(filters)
})
})

this.searchText$ = this.searchFacade.searchFilters$.pipe(
map((filters) => ('any' in filters ? (filters['any'] as string) : null))
)
}

createRecord() {
Expand Down

0 comments on commit 183e6a5

Please sign in to comment.