Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added location filter for meetups page #162

Merged
merged 4 commits into from
Jan 29, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

tags: krakow, meetup, Arduino, IoT, Azure

Location: Krakow

Check warning on line 13 in content/posts/meetups/arduino-weather-station-on-azure-iot/post.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/posts/meetups/arduino-weather-station-on-azure-iot/post.md#L13

[Google.Colons] ': K' should be in lowercase.
Raw output
{"message": "[Google.Colons] ': K' should be in lowercase.", "location": {"path": "content/posts/meetups/arduino-weather-station-on-azure-iot/post.md", "range": {"start": {"line": 13, "column": 9}}}, "severity": "WARNING"}
robinsonzimmermann marked this conversation as resolved.
Show resolved Hide resolved

---

## ✅ Book your spot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
Category: meetups

tags: krakow, meetup, Machine Learning

Location: Krakow

Check warning on line 13 in content/posts/meetups/challenges-of-machine-learning/post.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/posts/meetups/challenges-of-machine-learning/post.md#L13

[Google.Colons] ': K' should be in lowercase.
Raw output
{"message": "[Google.Colons] ': K' should be in lowercase.", "location": {"path": "content/posts/meetups/challenges-of-machine-learning/post.md", "range": {"start": {"line": 13, "column": 9}}}, "severity": "WARNING"}

---

Expand Down
2 changes: 2 additions & 0 deletions content/posts/meetups/easy-debugging-in-playwright/post.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

tags: krakow, meetup, Playwright, debugging

Location: Krakow

Check warning on line 13 in content/posts/meetups/easy-debugging-in-playwright/post.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/posts/meetups/easy-debugging-in-playwright/post.md#L13

[Google.Colons] ': K' should be in lowercase.
Raw output
{"message": "[Google.Colons] ': K' should be in lowercase.", "location": {"path": "content/posts/meetups/easy-debugging-in-playwright/post.md", "range": {"start": {"line": 13, "column": 9}}}, "severity": "WARNING"}

---

## ✅ Book your spot
Expand Down
2 changes: 2 additions & 0 deletions content/posts/meetups/friends-of-figma-x-backbase/post.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
Category: meetups

tags: krakow, meetup, UX

Location: Krakow

Check warning on line 13 in content/posts/meetups/friends-of-figma-x-backbase/post.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/posts/meetups/friends-of-figma-x-backbase/post.md#L13

[Google.Colons] ': K' should be in lowercase.
Raw output
{"message": "[Google.Colons] ': K' should be in lowercase.", "location": {"path": "content/posts/meetups/friends-of-figma-x-backbase/post.md", "range": {"start": {"line": 13, "column": 9}}}, "severity": "WARNING"}

---

Expand Down
2 changes: 2 additions & 0 deletions content/posts/meetups/generative-ai-friend-or-foe-/post.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
Category: meetups

tags: krakow, meetup, AI

Location: Krakow

Check warning on line 13 in content/posts/meetups/generative-ai-friend-or-foe-/post.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/posts/meetups/generative-ai-friend-or-foe-/post.md#L13

[Google.Colons] ': K' should be in lowercase.
Raw output
{"message": "[Google.Colons] ': K' should be in lowercase.", "location": {"path": "content/posts/meetups/generative-ai-friend-or-foe-/post.md", "range": {"start": {"line": 13, "column": 9}}}, "severity": "WARNING"}

---

Expand Down
2 changes: 2 additions & 0 deletions content/posts/meetups/github-actions/post.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

tags: krakow, meetup, Github, GitHub Actions

Location: Krakow

Check warning on line 13 in content/posts/meetups/github-actions/post.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/posts/meetups/github-actions/post.md#L13

[Google.Colons] ': K' should be in lowercase.
Raw output
{"message": "[Google.Colons] ': K' should be in lowercase.", "location": {"path": "content/posts/meetups/github-actions/post.md", "range": {"start": {"line": 13, "column": 9}}}, "severity": "WARNING"}

---

## ✅ Book your spot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
Category: meetups

tags: krakow, meetup, FinTech

Location: Krakow

Check warning on line 13 in content/posts/meetups/how-fintech-is-changing-financial-sector/post.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/posts/meetups/how-fintech-is-changing-financial-sector/post.md#L13

[Google.Colons] ': K' should be in lowercase.
Raw output
{"message": "[Google.Colons] ': K' should be in lowercase.", "location": {"path": "content/posts/meetups/how-fintech-is-changing-financial-sector/post.md", "range": {"start": {"line": 13, "column": 9}}}, "severity": "WARNING"}

---

Expand Down
2 changes: 2 additions & 0 deletions content/posts/meetups/impact-of-using-new-ai-tools/post.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

tags: krakow, meetup, AI, OpenAI

Location: Krakow

Check warning on line 13 in content/posts/meetups/impact-of-using-new-ai-tools/post.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/posts/meetups/impact-of-using-new-ai-tools/post.md#L13

[Google.Colons] ': K' should be in lowercase.
Raw output
{"message": "[Google.Colons] ': K' should be in lowercase.", "location": {"path": "content/posts/meetups/impact-of-using-new-ai-tools/post.md", "range": {"start": {"line": 13, "column": 9}}}, "severity": "WARNING"}

---

## ✅ Book your spot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
Category: meetups

tags: krakow, meetup, iOS

Location: Krakow

Check warning on line 13 in content/posts/meetups/innersourcing-on-backbase-customer/post.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/posts/meetups/innersourcing-on-backbase-customer/post.md#L13

[Google.Colons] ': K' should be in lowercase.
Raw output
{"message": "[Google.Colons] ': K' should be in lowercase.", "location": {"path": "content/posts/meetups/innersourcing-on-backbase-customer/post.md", "range": {"start": {"line": 13, "column": 9}}}, "severity": "WARNING"}

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
Category: meetups

tags: krakow, meetup, Cybergames

Location: Krakow

Check warning on line 13 in content/posts/meetups/learn-and-play-cybergames-meetup/post.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/posts/meetups/learn-and-play-cybergames-meetup/post.md#L13

[Google.Colons] ': K' should be in lowercase.
Raw output
{"message": "[Google.Colons] ': K' should be in lowercase.", "location": {"path": "content/posts/meetups/learn-and-play-cybergames-meetup/post.md", "range": {"start": {"line": 13, "column": 9}}}, "severity": "WARNING"}

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
Category: meetups

tags: krakow, meetup, Backend

Location: Krakow

Check warning on line 13 in content/posts/meetups/memory-management-for-data-structures/post.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/posts/meetups/memory-management-for-data-structures/post.md#L13

[Google.Colons] ': K' should be in lowercase.
Raw output
{"message": "[Google.Colons] ': K' should be in lowercase.", "location": {"path": "content/posts/meetups/memory-management-for-data-structures/post.md", "range": {"start": {"line": 13, "column": 9}}}, "severity": "WARNING"}

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
Category: meetups

tags: krakow, meetup, Learning

Location: Krakow

Check warning on line 13 in content/posts/meetups/methods-and-tools-for-effective-learning/post.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/posts/meetups/methods-and-tools-for-effective-learning/post.md#L13

[Google.Colons] ': K' should be in lowercase.
Raw output
{"message": "[Google.Colons] ': K' should be in lowercase.", "location": {"path": "content/posts/meetups/methods-and-tools-for-effective-learning/post.md", "range": {"start": {"line": 13, "column": 9}}}, "severity": "WARNING"}

---

Expand Down
2 changes: 2 additions & 0 deletions content/posts/meetups/new-features-of-java/post.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
Category: meetups

tags: krakow, meetup, Java, Back-end

Location: Krakow

Check warning on line 13 in content/posts/meetups/new-features-of-java/post.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/posts/meetups/new-features-of-java/post.md#L13

[Google.Colons] ': K' should be in lowercase.
Raw output
{"message": "[Google.Colons] ': K' should be in lowercase.", "location": {"path": "content/posts/meetups/new-features-of-java/post.md", "range": {"start": {"line": 13, "column": 9}}}, "severity": "WARNING"}

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
Category: meetups

tags: krakow, meetup, AI, Travel

Location: Krakow

Check warning on line 13 in content/posts/meetups/new-trends-in-ai-your-ticket-to-the-states/post.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/posts/meetups/new-trends-in-ai-your-ticket-to-the-states/post.md#L13

[Google.Colons] ': K' should be in lowercase.
Raw output
{"message": "[Google.Colons] ': K' should be in lowercase.", "location": {"path": "content/posts/meetups/new-trends-in-ai-your-ticket-to-the-states/post.md", "range": {"start": {"line": 13, "column": 9}}}, "severity": "WARNING"}

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
Category: meetups

tags: krakow, meetup, hacking, backend

Location: Krakow

Check warning on line 13 in content/posts/meetups/preventing-cross-site-scripting-attacks/post.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/posts/meetups/preventing-cross-site-scripting-attacks/post.md#L13

[Google.Colons] ': K' should be in lowercase.
Raw output
{"message": "[Google.Colons] ': K' should be in lowercase.", "location": {"path": "content/posts/meetups/preventing-cross-site-scripting-attacks/post.md", "range": {"start": {"line": 13, "column": 9}}}, "severity": "WARNING"}

---

Expand Down
2 changes: 2 additions & 0 deletions content/posts/meetups/taking-care-of-mental-health/post.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
Category: meetups

tags: krakow, meetup, Health

Location: Krakow

Check warning on line 13 in content/posts/meetups/taking-care-of-mental-health/post.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/posts/meetups/taking-care-of-mental-health/post.md#L13

[Google.Colons] ': K' should be in lowercase.
Raw output
{"message": "[Google.Colons] ': K' should be in lowercase.", "location": {"path": "content/posts/meetups/taking-care-of-mental-health/post.md", "range": {"start": {"line": 13, "column": 9}}}, "severity": "WARNING"}

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
Category: meetups

tags: krakow, meetup, Zero-Trust

Location: Krakow

Check warning on line 13 in content/posts/meetups/zero-trust-principles-for-developers/post.md

View workflow job for this annotation

GitHub Actions / vale

[vale] content/posts/meetups/zero-trust-principles-for-developers/post.md#L13

[Google.Colons] ': K' should be in lowercase.
Raw output
{"message": "[Google.Colons] ': K' should be in lowercase.", "location": {"path": "content/posts/meetups/zero-trust-principles-for-developers/post.md", "range": {"start": {"line": 13, "column": 9}}}, "severity": "WARNING"}

---

Expand Down
1 change: 1 addition & 0 deletions projects/utils/src/lib/post-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export function extractPostMetaData(post: string, metaonly: boolean = false) {
?.split(',')
.map(n => n.trim()) || [],
category: header.match(/^Category: ([^\n]+)/im)?.[1] || '',
location: header.match(/^Location: ([^\n]+)/im)?.[1] || '',
tags: header
.match(/^Tags: ([^\n]+)/im)?.[1]
?.split(',')
Expand Down
7 changes: 7 additions & 0 deletions src/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ export const routes: Routes = [
m => m.CategoryComponent
),
},
{
path: 'meetups/:loc',
loadComponent: () =>
import('./features/location/location.component').then(
m => m.LocationComponent
),
},
{
path: 'principles',
loadComponent: () =>
Expand Down
12 changes: 12 additions & 0 deletions src/app/components/locations/locations.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div class="center-container">
<mat-tab-group
(selectedTabChange)="onChange($event)"
[selectedIndex]="active ? locations.indexOf(active) + 1 : 0"
multiple="true"
aria-label="Location selection">
<mat-tab labelClass="hide"></mat-tab>
@for (category of locations; track $index) {
<mat-tab [labelClass]="category" [label]="Location[category]"></mat-tab>
}
</mat-tab-group>
</div>
4 changes: 4 additions & 0 deletions src/app/components/locations/locations.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
:host {
background: var(--blog-palette-neutral);
display: block;
}
22 changes: 22 additions & 0 deletions src/app/components/locations/locations.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { LocationsComponent } from './locations.component';

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

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

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

it('should create', () => {
expect(component).toBeTruthy();
});
});
23 changes: 23 additions & 0 deletions src/app/components/locations/locations.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MatTabChangeEvent, MatTabsModule } from '@angular/material/tabs';
import { Location } from '../../core/model/locations.model';

@Component({
selector: 'blog-locations',
standalone: true,
imports: [CommonModule, MatTabsModule],
templateUrl: './locations.component.html',
styleUrl: './locations.component.scss',
})
export class LocationsComponent {
@Input() locations!: Location[];
@Input() active!: Location | null;
@Output() selected = new EventEmitter<string | string[]>();

Location = Object.fromEntries(Object.entries(Location));

onChange(event: MatTabChangeEvent) {
this.selected.emit(event.tab.labelClass);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div class="center-container">
<mat-card data-role="button">
<div class="image">
<img src="assets/email-banner.png" alt="" />
</div>
</mat-card>
</div>
26 changes: 26 additions & 0 deletions src/app/components/meetup-footer/meetup-footer.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@use 'breakpoints' as responsive;

mat-card {
display: flex;
flex-direction: row;
padding: 1rem;

.title {
margin: 0;
padding: 0 1rem;
flex-wrap: wrap;
display: flex;
align-content: center;
}
}

img {
width: 100%;
}

[data-role='button'] {
transition: 0.15s ease-out transform;
&:hover {
transform: scale(1.02);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { MeetupFooterComponent } from './meetup-footer.component';

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

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

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

it('should create', () => {
expect(component).toBeTruthy();
});
});
13 changes: 13 additions & 0 deletions src/app/components/meetup-footer/meetup-footer.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Component } from '@angular/core';
import { MatCardModule } from '@angular/material/card';
import { MatRippleModule } from '@angular/material/core';

@Component({
selector: 'blog-meetup-footer',
standalone: true,
imports: [MatCardModule, MatRippleModule],
templateUrl: './meetup-footer.component.html',
styleUrl: './meetup-footer.component.scss',
})
export class MeetupFooterComponent {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@if (locations$ | async; as locations) {
<blog-locations
[locations]="locations"
[active]="selectedLocation$ | async"
(selected)="navigate($event)"></blog-locations>
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { LocationsTabComponent } from './locations-tab.component';

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

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

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

it('should create', () => {
expect(component).toBeTruthy();
});
});
33 changes: 33 additions & 0 deletions src/app/core/layout/locations-tab/locations-tab.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { Component } from '@angular/core';
import { Observable, map } from 'rxjs';
import { AsyncPipe } from '@angular/common';
import { ActivatedRoute, Router } from '@angular/router';
import { PostsService } from '../../services/posts.service';
import { Location } from '../../model/locations.model';
import { LocationsComponent } from "../../../components/locations/locations.component";

@Component({
selector: 'blog-locations-tab',
standalone: true,
imports: [AsyncPipe, LocationsComponent],
templateUrl: './locations-tab.component.html',
styleUrl: './locations-tab.component.scss',
})
export class LocationsTabComponent {
locations$: Observable<Location[]> = this.postsService
.getLocations();

selectedLocation$ = this.activatedRoute.paramMap.pipe(
map(params => params.get('loc') as Location)
);

constructor(
private postsService: PostsService,
private router: Router,
private activatedRoute: ActivatedRoute
) {}

navigate(selected: string | string[]) {
this.router.navigate(['location', selected]);
}
}
5 changes: 5 additions & 0 deletions src/app/core/model/locations.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export enum Location {
'Krakow' = 'Krakow',
'Hyderabad' = 'Hyderabad',
'Amsterdam' = 'Amsterdam',
}
2 changes: 2 additions & 0 deletions src/app/core/model/post.model.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Author } from './author.model';
import { Category } from './categories.model';
import { ProcessedAsset } from './content.model';
import { Location } from './locations.model';

export interface Post {
title: string;
Expand All @@ -11,6 +12,7 @@ export interface Post {
authors: Array<Author | string>;
featured?: boolean;
category: Category;
location?: Location;
tags: string[];
readingTime: string;
specialCategory: boolean;
Expand Down
Loading