From f7031b581664a172bf4621cb22992dcce42b5612 Mon Sep 17 00:00:00 2001 From: Steffi Erne Date: Mon, 18 Sep 2023 13:35:22 +0200 Subject: [PATCH 1/4] =?UTF-8?q?=E2=9C=A8=20embed=20app=20cat=20via=20iFram?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app-cat/app-cat.component.html | 6 ++++ src/app/app-cat/app-cat.component.scss | 49 ++++++++++++++++++++++++++ src/app/app-cat/app-cat.component.ts | 14 ++++++++ src/app/app-cat/app-cat.routing.ts | 4 +++ src/app/app.component.ts | 15 +++++++- src/app/app.routing.ts | 5 +++ 6 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 src/app/app-cat/app-cat.component.html create mode 100644 src/app/app-cat/app-cat.component.scss create mode 100644 src/app/app-cat/app-cat.component.ts create mode 100644 src/app/app-cat/app-cat.routing.ts diff --git a/src/app/app-cat/app-cat.component.html b/src/app/app-cat/app-cat.component.html new file mode 100644 index 00000000..a3e23532 --- /dev/null +++ b/src/app/app-cat/app-cat.component.html @@ -0,0 +1,6 @@ +
+
+

VSHN Application Catalog (AppCat)

+
+ +
diff --git a/src/app/app-cat/app-cat.component.scss b/src/app/app-cat/app-cat.component.scss new file mode 100644 index 00000000..0cff2bae --- /dev/null +++ b/src/app/app-cat/app-cat.component.scss @@ -0,0 +1,49 @@ +:host { + height: calc(100% + 2rem); + width: calc(100% + 4rem); + margin: -2rem; +} + +.header { + padding-left: 0.75rem; + padding-right: 0.75rem; +} + +/* Using the break points from services.appcat.ch (+280px for the sidebar on desktop) +** to set the width so the header with margin:auto is aligned with the iframe content +*/ +@media (min-width: 576px) { + .header { + width: 540px; + } +} + +@media (min-width: 768px) { + .header { + width: 720px; + } +} + +@media (min-width: 1048px) { + .header { + width: 720px; + } +} + +@media (min-width: 1272px) { + .header { + width: 960px; + } +} + +@media (min-width: 1480px) { + .header { + width: 1140px; + } +} + +@media (min-width: 1680px) { + .header { + width: 1312px; + } +} diff --git a/src/app/app-cat/app-cat.component.ts b/src/app/app-cat/app-cat.component.ts new file mode 100644 index 00000000..3e35b59e --- /dev/null +++ b/src/app/app-cat/app-cat.component.ts @@ -0,0 +1,14 @@ +import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +@Component({ + selector: 'app-app-cat', + standalone: true, + imports: [CommonModule], + templateUrl: './app-cat.component.html', + styleUrls: ['./app-cat.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush +}) +export class AppCatComponent { + +} diff --git a/src/app/app-cat/app-cat.routing.ts b/src/app/app-cat/app-cat.routing.ts new file mode 100644 index 00000000..9949cbe9 --- /dev/null +++ b/src/app/app-cat/app-cat.routing.ts @@ -0,0 +1,4 @@ +import { Routes } from '@angular/router'; +import { AppCatComponent } from './app-cat.component'; + +export const routes: Routes = [{ path: '', component: AppCatComponent }]; diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 33d6abe3..a24650bc 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -2,7 +2,15 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@ import { Store } from '@ngrx/store'; import { selectOrganizationSelectionEnabled } from './store/app.selectors'; import { Verb } from './store/app.reducer'; -import { faComment, faDatabase, faDollarSign, faGift, faSitemap, faUserGroup } from '@fortawesome/free-solid-svg-icons'; +import { + faBookOpen, + faComment, + faDatabase, + faDollarSign, + faGift, + faSitemap, + faUserGroup, +} from '@fortawesome/free-solid-svg-icons'; import { IconDefinition } from '@fortawesome/fontawesome-common-types'; import * as Sentry from '@sentry/browser'; import { AppConfigService } from './app-config.service'; @@ -181,6 +189,11 @@ export class AppComponent implements OnInit { routerLink: ['invitations'], }); } + this.menuItems.push({ + label: $localize`VSHN AppCat`, + icon: faBookOpen, + routerLink: ['app-cat'], + }); // needed to render the menu if other rendering tasks are running in the background, // e.g. polling invitations this.changeDetectorRef.markForCheck(); diff --git a/src/app/app.routing.ts b/src/app/app.routing.ts index 675d0c61..73f3fe88 100644 --- a/src/app/app.routing.ts +++ b/src/app/app.routing.ts @@ -54,4 +54,9 @@ export const appRoutes: Routes = [ loadChildren: () => import('./productboard/productboard.routing').then((m) => m.routes), title: $localize`Feedback`, }, + { + path: 'app-cat', + loadChildren: () => import('./app-cat/app-cat.routing').then((m) => m.routes), + title: $localize`AppCat`, + }, ]; From 0e00220d9553aebecfc43cd8a750c23baa9c0f1b Mon Sep 17 00:00:00 2001 From: Steffi Erne Date: Mon, 18 Sep 2023 13:40:59 +0200 Subject: [PATCH 2/4] =?UTF-8?q?=E2=9C=85=20add=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cypress/e2e/app-cat.cy.ts | 15 +++++++++++++++ src/app/app-cat/app-cat.component.ts | 6 ++---- 2 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 cypress/e2e/app-cat.cy.ts diff --git a/cypress/e2e/app-cat.cy.ts b/cypress/e2e/app-cat.cy.ts new file mode 100644 index 00000000..e8cc0c51 --- /dev/null +++ b/cypress/e2e/app-cat.cy.ts @@ -0,0 +1,15 @@ +describe('Test AppCat embed', () => { + beforeEach(() => { + cy.setupAuth(); + }); + beforeEach(() => { + // needed for initial getUser request + cy.setPermission({ verb: 'list', resource: 'zones', group: 'rbac.appuio.io' }); + cy.disableCookieBanner(); + }); + + it('shows the application catalog', () => { + cy.visit('/app-cat'); + cy.get('iframe').children().should('not.be.empty'); + }); +}); diff --git a/src/app/app-cat/app-cat.component.ts b/src/app/app-cat/app-cat.component.ts index 3e35b59e..d37bcb0b 100644 --- a/src/app/app-cat/app-cat.component.ts +++ b/src/app/app-cat/app-cat.component.ts @@ -7,8 +7,6 @@ import { CommonModule } from '@angular/common'; imports: [CommonModule], templateUrl: './app-cat.component.html', styleUrls: ['./app-cat.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, }) -export class AppCatComponent { - -} +export class AppCatComponent {} From 721982182260022709ed585c41a1bdb9f1391b1a Mon Sep 17 00:00:00 2001 From: Stefanie Erne Date: Mon, 18 Sep 2023 14:03:33 +0200 Subject: [PATCH 3/4] Title change from tobru Co-authored-by: Tobias Brunner --- src/app/app-cat/app-cat.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/app-cat/app-cat.component.html b/src/app/app-cat/app-cat.component.html index a3e23532..38b9cffa 100644 --- a/src/app/app-cat/app-cat.component.html +++ b/src/app/app-cat/app-cat.component.html @@ -1,6 +1,6 @@
-

VSHN Application Catalog (AppCat)

+

VSHN AppCat Service Offering

From 47ff561a33d1eb112df23abc92be945e298dd23c Mon Sep 17 00:00:00 2001 From: Steffi Erne Date: Mon, 18 Sep 2023 14:05:58 +0200 Subject: [PATCH 4/4] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20simplify=20css?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app-cat/app-cat.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/app-cat/app-cat.component.html b/src/app/app-cat/app-cat.component.html index 38b9cffa..a74093f5 100644 --- a/src/app/app-cat/app-cat.component.html +++ b/src/app/app-cat/app-cat.component.html @@ -1,6 +1,6 @@
-

VSHN AppCat Service Offering

+

VSHN AppCat Service Offering

- +