Skip to content

Commit

Permalink
chore: various fixes on web components
Browse files Browse the repository at this point in the history
  • Loading branch information
jahow committed Jul 28, 2023
1 parent a5a3a32 commit 2b9a3f8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
6 changes: 6 additions & 0 deletions apps/webcomponents/src/app/components/base.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ export class BaseComponent implements OnChanges, OnInit {
ngOnChanges() {
if (!this.isInitialized && this.apiUrl) {
this.init()
} else {
this.changes()
}
}

Expand All @@ -73,6 +75,10 @@ export class BaseComponent implements OnChanges, OnInit {
this.isInitialized = true
}

changes() {
// to override
}

async getRecordLink(uuid: string, usages: LinkUsage[]) {
const record = await firstValueFrom(
this.searchService.search(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
background-color="#fdfbff"
main-font="'Inter', sans-serif"
title-font="'DM Serif Display', serif"
style="width: 100%; height: 100%"
></gn-map-viewer>
</main>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import {
Component,
Injector,
Input,
OnChanges,
OnInit,
ViewEncapsulation,
} from '@angular/core'
import {
Expand All @@ -28,10 +26,7 @@ import { BaseComponent } from '../base.component'
encapsulation: ViewEncapsulation.ShadowDom,
providers: [SearchFacade],
})
export class GnResultsListComponent
extends BaseComponent
implements OnInit, OnChanges
{
export class GnResultsListComponent extends BaseComponent {
@Input() layout = 'CARD'
@Input() size = '10' // will be converted to number later
@Input() query: string
Expand Down Expand Up @@ -88,4 +83,9 @@ export class GnResultsListComponent
window.open(landingPage, '_blank').focus()
}
}

changes(): void {
super.changes()
this.setSearch_()
}
}

0 comments on commit 2b9a3f8

Please sign in to comment.