Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@typescript-eslint/eslint-plugin": "7",
"@typescript-eslint/parser": "7",
"bootstrap": "^5.3.3",
"colorthief": "^2.6.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsdoc": "^50.6.8",
"express": "^4.18.2",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 21 additions & 3 deletions website/src/app/app.routes.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
import { Routes } from '@angular/router';

const loadTemplateGallery = () => import('./features/template-gallery').then(m => m.TemplateGalleryComponent);
const loadTemplateDetails = () => import('./features/template-details').then(m => m.TemplateDetailsComponent);
const loadPlatformView = () => import('./features/platform-view').then(m => m.PlatformViewComponent);

export const routes: Routes = [
{ path: 'template/:id', loadComponent: () => import('./features/template-details').then(m => m.TemplateDetailsComponent) },
{ path: ':type', loadComponent: () => import('./features/template-gallery').then(m => m.TemplateGalleryComponent) },
{ path: '', redirectTo: '/all', pathMatch: 'full' }
{
path: 'all',
loadComponent: loadTemplateGallery
},
{
path: 'platforms/:type',
loadComponent: loadPlatformView,
},
{
path: 'platforms/:type/definitions/:id',
loadComponent: loadTemplateDetails
},
{
path: 'definitions/:id',
loadComponent: loadTemplateDetails
},
{ path: '', redirectTo: '/all', pathMatch: 'full' },
];
1 change: 1 addition & 0 deletions website/src/app/features/platform-view/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './platform-view.component';
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<div class="pt-5 ps-5 pe-5" >
<div class="pb-5" *ngIf="platform$ | async as platform">
<mst-card [label]="platform.title" [borderColorSourceImage]="platform.logo">
<div class="card-body d-flex" card-body>
<mst-logo-circle [title]="platform.title" [sourceImage]="platform.logo" [size]="'md'"></mst-logo-circle>
<h5 class="ms-3 card-title fw-bold align-self-center">
{{ platform.title }}
</h5>
</div>
</mst-card>
</div>

<h2>Platform building block definitions</h2>
These building block definitions provide pre-configured Terraform modules for automating common cloud tasks

<div class="row mt-4">
<ng-container *ngIf="templates$ | async as templates">
<ng-container *ngIf="templates.length > 0; else noTemplates">
<div class="col-sm-3 mb-3" *ngFor="let template of templates">
<mst-definition-card [card]="template"></mst-definition-card>
</div>
</ng-container>
<ng-template #noTemplates>
<p class="p-2">No building block definitions</p>
</ng-template>
</ng-container>
</div>
</div>
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { PlatformViewComponent } from './platform-view.component';

describe('PlatformViewComponent', () => {
let component: PlatformViewComponent;
let fixture: ComponentFixture<PlatformViewComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [PlatformViewComponent]
})
.compileComponents();

fixture = TestBed.createComponent(PlatformViewComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component)
.toBeTruthy();
});
});
93 changes: 93 additions & 0 deletions website/src/app/features/platform-view/platform-view.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import { CommonModule } from '@angular/common';
import { Component, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { Observable, Subscription, forkJoin, map } from 'rxjs';

import { PlatformType } from 'app/core';
import { CardComponent } from 'app/shared/card';
import { DefinitionCard } from 'app/shared/definition-card/definition-card';
import { DefinitionCardComponent } from 'app/shared/definition-card/definition-card.component';
import { LogoCircleComponent } from 'app/shared/logo-circle/logo-circle.component';
import { PlatformData, PlatformService } from 'app/shared/platform-logo';
import { TemplateService } from 'app/shared/template';

interface PlatformVM {
logo: string | null;
title: string;
}

@Component({
selector: 'mst-platform-view',
imports: [CommonModule, DefinitionCardComponent, CardComponent, LogoCircleComponent],
templateUrl: './platform-view.component.html',
styleUrl: './platform-view.component.scss',
standalone: true
})
export class PlatformViewComponent implements OnInit, OnDestroy {
public platform$!: Observable<PlatformVM>;

public templates$!: Observable<DefinitionCard[]>;

private paramSubscription!: Subscription;

private platformData$!: Observable<PlatformData>;

constructor(
private router: Router,
private route: ActivatedRoute,
private templateService: TemplateService,
private platformLogoService: PlatformService
) { }

public ngOnInit(): void {
this.subscribeToRouteParams();
}

public ngOnDestroy(): void {
this.paramSubscription.unsubscribe();
}

private subscribeToRouteParams(): void {
this.paramSubscription = this.route.paramMap.subscribe(params => {
const type = params.get('type');

if (type) {
const templateObs$ = this.templateService.filterTemplatesByPlatformType(type as PlatformType);
this.platformData$ = this.platformLogoService.getAllPlatformData();
this.platform$ = this.platformData$.pipe(
map(platformData => ({
logo: platformData[type]?.logo ?? null,
title: platformData[type]?.name ?? ''
}),

)
);
this.templates$ = this.getTemplatesWithLogos(templateObs$, type);

} else {
this.router.navigate(['/all']);
}
});
}

private getTemplatesWithLogos(templateObs$: Observable<any>, type: string): Observable<DefinitionCard[]> {
return forkJoin({
templates: templateObs$,
platforms: this.platformData$
})
.pipe(
map(({ templates, platforms }) =>
templates.map(item => ({
cardLogo: item.logo,
title: item.name,
description: item.description,
routePath: `/platforms/${type}/definitions/${item.id}`,
supportedPlatforms: item.supportedPlatforms.map(platform => ({
platformType: platform,
imageUrl: platforms[item.platformType].logo ?? null
}))
}))
)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h5 class="card-text mt-3">to continue using this building block template</h5>
<p>Check it out and how it can help your platform team</p>
<a href="https://www.meshcloud.io/en/book-demo" class="btn btn-outline-primary mt-2">
Discover meshStack
<img src="assets/meshstack-logo.png" alt="meshStack Logo" class="button-image" />
<img src="assets/meshstack-logo-black-white.png" alt="meshStack Logo" class="button-image" />
</a>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,3 @@
width: 5rem;
object-fit: contain;
}

.button-image {
width: 2rem;
object-fit: contain;
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<div class="pt-5 ps-5 pe-5">
<div class="row">
<ng-container *ngIf="template$ | async as template">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item ps-0"><a href="#">Overview</a></li>
<li class="breadcrumb-item active" aria-current="page">{{ template.name }}</li>
</ol>
</nav>
<ng-container *ngIf="breadcrumbs$ | async as breadcrumbs">
<mst-breadcrumb [breadcrumbs]="breadcrumbs"></mst-breadcrumb>
</ng-container>

<div class="pt-5">
<div class="d-flex">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
.breadcrumb-item a {
color: gray;
text-decoration: none;

&:hover {
text-decoration: underline;
}
}

.breadcrumb-item.active {
color: black;
font-weight: bold;
}

.breadcrumb-item + .breadcrumb-item::before {
content: ' > ';
padding: 0 5rem;
}

.logo {
width: 5rem;
object-fit: contain;
Expand All @@ -26,10 +7,3 @@
white-space: pre-wrap;
line-height: 2rem;
}

.breadcrumb-item + .breadcrumb-item::before {
content: '\f054';
font-family: 'Font Awesome 6 Free';
font-weight: 900;
color: gray;
}
Loading
Loading