From e47f126bd5f930d8ce5b556388cb82dcc8c32ffe Mon Sep 17 00:00:00 2001 From: Alex Inkin Date: Tue, 19 Dec 2023 01:43:59 +0400 Subject: [PATCH] feat(portal): refactor marketplace for new portal (#2539) * feat(portal): refactor marketplace for new portal * fix background position * chore: refactor sidebar * chore: small fix --------- Co-authored-by: Lucy Cifferello <12953208+elvece@users.noreply.github.com> --- .../src/components/menu/menu.component.html | 2 +- .../src/components/menu/menu.component.scss | 13 ++ .../src/components/menu/menu.component.ts | 5 - web/projects/shared/styles/taiga.scss | 106 +++------ .../components/card/card.component.html | 6 +- .../portal/components/card/card.component.ts | 9 +- .../navigation/navigation.component.html | 8 +- .../navigation/navigation.component.ts | 6 +- .../apps/portal/constants/system-utilities.ts | 14 +- .../service/components/menu.component.ts | 34 ++- .../routes/service/pipes/to-menu.pipe.ts | 24 +- .../components/controls.component.ts | 189 +++++++++++++++ .../marketplace/components/menu.component.ts | 47 ++++ .../components/notification.component.ts | 77 ++++++ .../components/registry.component.ts | 37 +++ .../components/sidebars.component.ts | 30 +++ .../marketplace/components/tile.component.ts | 111 +++++++++ .../marketplace/marketplace.component.ts | 89 +++++++ .../system/marketplace/marketplace.routes.ts | 12 + .../marketplace/modals/preview.component.ts | 98 ++++++++ .../marketplace/modals/registry.component.ts | 221 ++++++++++++++++++ .../system/marketplace/pipes/to-local.pipe.ts | 17 ++ .../marketplace/services/alerts.service.ts | 84 +++++++ .../marketplace/services/sidebar.service.ts | 5 + .../system/marketplace/utils/registry.ts | 50 ++++ .../system/sideload/package.component.ts | 11 +- .../portal/routes/system/system.module.ts | 6 + .../updates/components/item.component.ts | 21 +- .../marketplace-show-controls.component.ts | 10 +- .../marketplace-show-preview.module.ts | 2 +- .../services/api/embassy-mock-api.service.ts | 6 +- web/projects/ui/src/styles.scss | 6 +- 32 files changed, 1201 insertions(+), 155 deletions(-) create mode 100644 web/projects/ui/src/app/apps/portal/routes/system/marketplace/components/controls.component.ts create mode 100644 web/projects/ui/src/app/apps/portal/routes/system/marketplace/components/menu.component.ts create mode 100644 web/projects/ui/src/app/apps/portal/routes/system/marketplace/components/notification.component.ts create mode 100644 web/projects/ui/src/app/apps/portal/routes/system/marketplace/components/registry.component.ts create mode 100644 web/projects/ui/src/app/apps/portal/routes/system/marketplace/components/sidebars.component.ts create mode 100644 web/projects/ui/src/app/apps/portal/routes/system/marketplace/components/tile.component.ts create mode 100644 web/projects/ui/src/app/apps/portal/routes/system/marketplace/marketplace.component.ts create mode 100644 web/projects/ui/src/app/apps/portal/routes/system/marketplace/marketplace.routes.ts create mode 100644 web/projects/ui/src/app/apps/portal/routes/system/marketplace/modals/preview.component.ts create mode 100644 web/projects/ui/src/app/apps/portal/routes/system/marketplace/modals/registry.component.ts create mode 100644 web/projects/ui/src/app/apps/portal/routes/system/marketplace/pipes/to-local.pipe.ts create mode 100644 web/projects/ui/src/app/apps/portal/routes/system/marketplace/services/alerts.service.ts create mode 100644 web/projects/ui/src/app/apps/portal/routes/system/marketplace/services/sidebar.service.ts create mode 100644 web/projects/ui/src/app/apps/portal/routes/system/marketplace/utils/registry.ts diff --git a/web/projects/marketplace/src/components/menu/menu.component.html b/web/projects/marketplace/src/components/menu/menu.component.html index d1a8bac4ea..84170e4c1b 100644 --- a/web/projects/marketplace/src/components/menu/menu.component.html +++ b/web/projects/marketplace/src/components/menu/menu.component.html @@ -1,5 +1,5 @@
- + `, standalone: true, diff --git a/web/projects/ui/src/app/apps/portal/routes/system/system.module.ts b/web/projects/ui/src/app/apps/portal/routes/system/system.module.ts index dc6f224ad3..c8000e851b 100644 --- a/web/projects/ui/src/app/apps/portal/routes/system/system.module.ts +++ b/web/projects/ui/src/app/apps/portal/routes/system/system.module.ts @@ -11,6 +11,12 @@ const ROUTES: Routes = [ import('./backups/backups.component').then(m => m.BackupsComponent), data: toNavigationItem('/portal/system/backups'), }, + { + title: systemTabResolver, + path: 'marketplace', + loadChildren: () => import('./marketplace/marketplace.routes'), + data: toNavigationItem('/portal/system/marketplace'), + }, { title: systemTabResolver, path: 'settings', diff --git a/web/projects/ui/src/app/apps/portal/routes/system/updates/components/item.component.ts b/web/projects/ui/src/app/apps/portal/routes/system/updates/components/item.component.ts index e5e2dfb821..22aeb6b4e7 100644 --- a/web/projects/ui/src/app/apps/portal/routes/system/updates/components/item.component.ts +++ b/web/projects/ui/src/app/apps/portal/routes/system/updates/components/item.component.ts @@ -16,9 +16,12 @@ import { TuiDialogService, TuiLinkModule, TuiLoaderModule, - TuiSvgModule, } from '@taiga-ui/core' -import { TuiAvatarModule, TuiButtonModule } from '@taiga-ui/experimental' +import { + TuiAvatarModule, + TuiButtonModule, + TuiIconModule, +} from '@taiga-ui/experimental' import { TUI_PROMPT, TuiAccordionModule, @@ -35,27 +38,25 @@ import { InstallProgressPipe } from '../pipes/install-progress.pipe' template: `
- +
{{ marketplacePkg.manifest.title }}
{{ localPkg.manifest.version || '' | displayEmver }} - + {{ marketplacePkg.manifest.version | displayEmver }}
-
- {{ errors }} -
+
{{ errors }}
+ />
@@ -116,7 +117,7 @@ import { InstallProgressPipe } from '../pipes/install-progress.pipe' TuiProgressModule, TuiAccordionModule, TuiAvatarModule, - TuiSvgModule, + TuiIconModule, TuiButtonModule, TuiLinkModule, TuiLoaderModule, diff --git a/web/projects/ui/src/app/apps/ui/pages/marketplace/marketplace-show-preview/components/marketplace-show-controls.component.ts b/web/projects/ui/src/app/apps/ui/pages/marketplace/marketplace-show-preview/components/marketplace-show-controls.component.ts index 98d89492a4..8bf8b05489 100644 --- a/web/projects/ui/src/app/apps/ui/pages/marketplace/marketplace-show-preview/components/marketplace-show-controls.component.ts +++ b/web/projects/ui/src/app/apps/ui/pages/marketplace/marketplace-show-preview/components/marketplace-show-controls.component.ts @@ -44,7 +44,7 @@ import { CommonModule } from '@angular/common' import { IonicModule } from '@ionic/angular' import { RouterModule } from '@angular/router' -import { TuiButtonModule } from '@taiga-ui/core' +import { TuiButtonModule } from '@taiga-ui/experimental' @Component({ selector: 'marketplace-show-controls', @@ -67,7 +67,7 @@ import { TuiButtonModule } from '@taiga-ui/core' type="button" class="mr-2" appearance="warning-solid" - *ngIf="(localVersion | compareEmver : pkg.manifest.version) === -1" + *ngIf="(localVersion | compareEmver: pkg.manifest.version) === -1" (click)="tryInstall()" > Update @@ -77,7 +77,7 @@ import { TuiButtonModule } from '@taiga-ui/core' type="button" class="mr-2" appearance="secondary-solid" - *ngIf="(localVersion | compareEmver : pkg.manifest.version) === 1" + *ngIf="(localVersion | compareEmver: pkg.manifest.version) === 1" (click)="tryInstall()" > Downgrade @@ -88,7 +88,7 @@ import { TuiButtonModule } from '@taiga-ui/core' type="button" class="mr-2" appearance="tertiary-solid" - *ngIf="(localVersion | compareEmver : pkg.manifest.version) === 0" + *ngIf="(localVersion | compareEmver: pkg.manifest.version) === 0" (click)="tryInstall()" > Reinstall @@ -101,7 +101,7 @@ import { TuiButtonModule } from '@taiga-ui/core'