From d202cb731d403ab5db112ef8ec4c80b9fa5afcf4 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Mon, 25 Mar 2024 13:31:30 -0600 Subject: [PATCH] fix bugs --- .../header/notifications.component.ts | 8 +++- .../interface-addresses.component.ts | 27 ++++++++++--- .../interface-clearnet.component.ts | 21 +++------- .../interfaces/interface-local.component.ts | 18 ++------- .../interfaces/interface-tor.component.ts | 26 +++---------- .../routes/dashboard/controls.component.ts | 10 ++--- .../routes/dashboard/service.component.ts | 2 +- .../routes/dashboard/status.component.ts | 6 +-- .../service/routes/service.component.ts | 1 - .../routes/domains/table.component.ts | 8 +--- .../system/settings/settings.service.ts | 8 +--- .../updates/pipes/filter-updates.pipe.ts | 1 - .../system/updates/updates.component.ts | 9 +++-- .../app/apps/portal/services/badge.service.ts | 6 ++- .../services/api/embassy-mock-api.service.ts | 38 +++++++++---------- 15 files changed, 80 insertions(+), 109 deletions(-) diff --git a/web/projects/ui/src/app/apps/portal/components/header/notifications.component.ts b/web/projects/ui/src/app/apps/portal/components/header/notifications.component.ts index 91c8c3da7..e58737dd0 100644 --- a/web/projects/ui/src/app/apps/portal/components/header/notifications.component.ts +++ b/web/projects/ui/src/app/apps/portal/components/header/notifications.component.ts @@ -25,6 +25,7 @@ import { ServerNotifications, } from 'src/app/services/api/api.types' import { NotificationService } from '../../services/notification.service' +import { ToManifestPipe } from '../../pipes/to-manifest' @Component({ selector: 'header-notifications', @@ -47,7 +48,11 @@ import { NotificationService } from '../../services/notification.service' [notification]="not" > - {{ $any(packageData[pkgId])?.manifest.title || pkgId }} + {{ + packageData[pkgId] + ? (packageData[pkgId] | toManifest).title + : pkgId + }} + `, - imports: [NgIf, TuiCellModule, TuiTitleModule, TuiButtonModule], + imports: [ + NgIf, + TuiCellModule, + TuiTitleModule, + TuiButtonModule, + TuiBadgeModule, + ], changeDetection: ChangeDetectionStrategy.OnPush, }) export class InterfaceAddressComponent { @@ -84,4 +99,6 @@ export class InterfaceAddressComponent { }) .subscribe() } + + destroy() {} } diff --git a/web/projects/ui/src/app/apps/portal/components/interfaces/interface-clearnet.component.ts b/web/projects/ui/src/app/apps/portal/components/interfaces/interface-clearnet.component.ts index 8b30037e1..c60e67323 100644 --- a/web/projects/ui/src/app/apps/portal/components/interfaces/interface-clearnet.component.ts +++ b/web/projects/ui/src/app/apps/portal/components/interfaces/interface-clearnet.component.ts @@ -43,26 +43,17 @@ type ClearnetForm = { View instructions - + @for ( + address of interface.serviceInterface.addresses.clearnet; + track $index + ) { -
- -
-
- + } @empty { - + } `, imports: [NgForOf, InterfaceAddressComponent, NgIf, TuiButtonModule], changeDetection: ChangeDetectionStrategy.OnPush, diff --git a/web/projects/ui/src/app/apps/portal/components/interfaces/interface-local.component.ts b/web/projects/ui/src/app/apps/portal/components/interfaces/interface-local.component.ts index 4b2ad8d11..ca54cf39e 100644 --- a/web/projects/ui/src/app/apps/portal/components/interfaces/interface-local.component.ts +++ b/web/projects/ui/src/app/apps/portal/components/interfaces/interface-local.component.ts @@ -20,26 +20,14 @@ import { InterfaceAddressComponent } from './interface-addresses.component' - + @for (address of interface.serviceInterface.addresses.local; track $index) { -
- -
-
- + } @empty { - + } `, imports: [NgForOf, NgIf, InterfaceAddressComponent, TuiButtonModule], changeDetection: ChangeDetectionStrategy.OnPush, diff --git a/web/projects/ui/src/app/apps/portal/components/interfaces/interface-tor.component.ts b/web/projects/ui/src/app/apps/portal/components/interfaces/interface-tor.component.ts index 6614687d2..e6e3e6d78 100644 --- a/web/projects/ui/src/app/apps/portal/components/interfaces/interface-tor.component.ts +++ b/web/projects/ui/src/app/apps/portal/components/interfaces/interface-tor.component.ts @@ -2,6 +2,7 @@ import { ChangeDetectionStrategy, Component, inject } from '@angular/core' import { InterfaceAddressComponent } from './interface-addresses.component' import { InterfaceComponent } from './interface.component' import { NgForOf, NgIf } from '@angular/common' +import { TuiButtonModule } from '@taiga-ui/experimental' @Component({ standalone: true, @@ -19,23 +20,14 @@ import { NgForOf, NgIf } from '@angular/common' - + @for (address of interface.serviceInterface.addresses.tor; track $index) { -
- -
-
- + } @empty { - - - + } `, - imports: [NgForOf, NgIf, InterfaceAddressComponent], + imports: [NgForOf, NgIf, InterfaceAddressComponent, TuiButtonModule], changeDetection: ChangeDetectionStrategy.OnPush, }) export class InterfaceTorComponent { diff --git a/web/projects/ui/src/app/apps/portal/routes/dashboard/controls.component.ts b/web/projects/ui/src/app/apps/portal/routes/dashboard/controls.component.ts index 195924ec4..34747cb0a 100644 --- a/web/projects/ui/src/app/apps/portal/routes/dashboard/controls.component.ts +++ b/web/projects/ui/src/app/apps/portal/routes/dashboard/controls.component.ts @@ -40,10 +40,10 @@ import { Manifest } from '@start9labs/marketplace' } @else {