Skip to content

Commit

Permalink
Display fetched feature data. (#13)
Browse files Browse the repository at this point in the history
* Display fetched feature data.

* prettier
  • Loading branch information
jrobbins authored Feb 13, 2024
1 parent 4703842 commit 7ab5c5c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions frontend/src/static/js/components/webstatus-feature-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,17 @@ export class FeaturePage extends LitElement {
@state()
feature?: components['schemas']['Feature'] | undefined

id!: string

featureId!: string
@state()
loading: boolean = true

location!: { params: { featureId: string } } // Set by router.

async firstUpdated(): Promise<void> {
this.feature = await this.apiClient.getFeature(this.id)
// TODO(jrobbins): Use routerContext instead of this.location so that
// nested components could also access the router.
this.featureId = this.location.params.featureId
this.feature = await this.apiClient.getFeature(this.featureId)
this.loading = false
}

Expand All @@ -45,7 +49,7 @@ export class FeaturePage extends LitElement {
return html`Loading`
} else {
return html`
<h1>Feature Page</h1>
<h1>${this.feature?.name}</h1>
spec size: ${this.feature?.spec != null ? this.feature.spec.length : 0}
<br />
Specs:
Expand Down

0 comments on commit 7ab5c5c

Please sign in to comment.