Skip to content

Commit efad859

Browse files
authored
added location filter for meetups page (#162)
* added location filter for meetups page * update posts with location * fix comments * update meetup-scaffold
1 parent 82f340d commit efad859

File tree

43 files changed

+447
-11
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+447
-11
lines changed

content/posts/meetups/arduino-weather-station-on-azure-iot/post.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Category: meetups
1010

1111
tags: krakow, meetup, Arduino, IoT, Azure
1212

13+
Location: Krakow
14+
1315
---
1416

1517
## ✅ Book your spot

content/posts/meetups/challenges-of-machine-learning/post.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Date: 2023-10-01T07:09:11.368Z
99
Category: meetups
1010

1111
tags: krakow, meetup, Machine Learning
12+
13+
Location: Krakow
1214

1315
---
1416

content/posts/meetups/easy-debugging-in-playwright/post.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Category: meetups
1010

1111
tags: krakow, meetup, Playwright, debugging
1212

13+
Location: Krakow
14+
1315
---
1416

1517
## ✅ Book your spot

content/posts/meetups/friends-of-figma-x-backbase/post.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Date: 2025-01-07T07:18:14.406Z
99
Category: meetups
1010

1111
tags: krakow, meetup, UX
12+
13+
Location: Krakow
1214

1315
---
1416

content/posts/meetups/generative-ai-friend-or-foe-/post.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Date: 2024-02-01T07:15:19.654Z
99
Category: meetups
1010

1111
tags: krakow, meetup, AI
12+
13+
Location: Krakow
1214

1315
---
1416

content/posts/meetups/github-actions/post.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Category: meetups
1010

1111
tags: krakow, meetup, Github, GitHub Actions
1212

13+
Location: Krakow
14+
1315
---
1416

1517
## ✅ Book your spot

content/posts/meetups/how-fintech-is-changing-financial-sector/post.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Date: 2023-05-01T07:03:38.357Z
99
Category: meetups
1010

1111
tags: krakow, meetup, FinTech
12+
13+
Location: Krakow
1214

1315
---
1416

content/posts/meetups/impact-of-using-new-ai-tools/post.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Category: meetups
1010

1111
tags: krakow, meetup, AI, OpenAI
1212

13+
Location: Krakow
14+
1315
---
1416

1517
## ✅ Book your spot

content/posts/meetups/innersourcing-on-backbase-customer/post.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Date: 2023-06-01T07:05:04.716Z
99
Category: meetups
1010

1111
tags: krakow, meetup, iOS
12+
13+
Location: Krakow
1214

1315
---
1416

content/posts/meetups/learn-and-play-cybergames-meetup/post.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Date: 2024-07-01T08:56:49.711Z
99
Category: meetups
1010

1111
tags: krakow, meetup, Cybergames
12+
13+
Location: Krakow
1214

1315
---
1416

content/posts/meetups/memory-management-for-data-structures/post.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Date: 2024-11-01T08:59:33.493Z
99
Category: meetups
1010

1111
tags: krakow, meetup, Backend
12+
13+
Location: Krakow
1214

1315
---
1416

content/posts/meetups/methods-and-tools-for-effective-learning/post.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Date: 2023-12-01T07:11:29.876Z
99
Category: meetups
1010

1111
tags: krakow, meetup, Learning
12+
13+
Location: Krakow
1214

1315
---
1416

content/posts/meetups/new-features-of-java/post.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Date: 2023-11-01T07:10:03.011Z
99
Category: meetups
1010

1111
tags: krakow, meetup, Java, Back-end
12+
13+
Location: Krakow
1214

1315
---
1416

content/posts/meetups/new-trends-in-ai-your-ticket-to-the-states/post.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Date: 2024-12-01T09:00:11.276Z
99
Category: meetups
1010

1111
tags: krakow, meetup, AI, Travel
12+
13+
Location: Krakow
1214

1315
---
1416

content/posts/meetups/preventing-cross-site-scripting-attacks/post.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Date: 2023-09-01T07:06:24.046Z
99
Category: meetups
1010

1111
tags: krakow, meetup, hacking, backend
12+
13+
Location: Krakow
1214

1315
---
1416

content/posts/meetups/taking-care-of-mental-health/post.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Date: 2024-06-01T08:56:12.211Z
99
Category: meetups
1010

1111
tags: krakow, meetup, Health
12+
13+
Location: Krakow
1214

1315
---
1416

content/posts/meetups/zero-trust-principles-for-developers/post.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Date: 2024-01-01T07:14:28.488Z
99
Category: meetups
1010

1111
tags: krakow, meetup, Zero-Trust
12+
13+
Location: Krakow
1214

1315
---
1416

projects/utils/src/lib/post-metadata.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export function extractPostMetaData(post: string, metaonly: boolean = false) {
1111
?.split(',')
1212
.map(n => n.trim()) || [],
1313
category: header.match(/^Category: ([^\n]+)/im)?.[1] || '',
14+
location: header.match(/^Location: ([^\n]+)/im)?.[1] || '',
1415
tags: header
1516
.match(/^Tags: ([^\n]+)/im)?.[1]
1617
?.split(',')

src/app/app.routes.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ export const routes: Routes = [
4444
m => m.CategoryComponent
4545
),
4646
},
47+
{
48+
path: 'meetups/:loc',
49+
loadComponent: () =>
50+
import('./features/location/location.component').then(
51+
m => m.LocationComponent
52+
),
53+
},
4754
{
4855
path: 'principles',
4956
loadComponent: () =>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<div class="center-container">
2+
<mat-tab-group
3+
(selectedTabChange)="onChange($event)"
4+
[selectedIndex]="active ? locations.indexOf(active) + 1 : 0"
5+
multiple="true"
6+
aria-label="Location selection">
7+
<mat-tab labelClass="hide"></mat-tab>
8+
@for (category of locations; track $index) {
9+
<mat-tab [labelClass]="category" [label]="Location[category]"></mat-tab>
10+
}
11+
</mat-tab-group>
12+
</div>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
:host {
2+
background: var(--blog-palette-neutral);
3+
display: block;
4+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { LocationsComponent } from './locations.component';
4+
5+
describe('LocationsComponent', () => {
6+
let component: LocationsComponent;
7+
let fixture: ComponentFixture<LocationsComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
imports: [LocationsComponent],
12+
}).compileComponents();
13+
14+
fixture = TestBed.createComponent(LocationsComponent);
15+
component = fixture.componentInstance;
16+
fixture.detectChanges();
17+
});
18+
19+
it('should create', () => {
20+
expect(component).toBeTruthy();
21+
});
22+
});
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { Component, EventEmitter, Input, Output } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
import { MatTabChangeEvent, MatTabsModule } from '@angular/material/tabs';
4+
import { Location } from '../../core/model/locations.model';
5+
6+
@Component({
7+
selector: 'blog-locations',
8+
standalone: true,
9+
imports: [CommonModule, MatTabsModule],
10+
templateUrl: './locations.component.html',
11+
styleUrl: './locations.component.scss',
12+
})
13+
export class LocationsComponent {
14+
@Input() locations!: Location[];
15+
@Input() active!: Location | null;
16+
@Output() selected = new EventEmitter<string | string[]>();
17+
18+
Location = Object.fromEntries(Object.entries(Location));
19+
20+
onChange(event: MatTabChangeEvent) {
21+
this.selected.emit(event.tab.labelClass);
22+
}
23+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<div class="center-container">
2+
<mat-card data-role="button">
3+
<div class="image">
4+
<img src="assets/email-banner.png" alt="" />
5+
</div>
6+
</mat-card>
7+
</div>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@use 'breakpoints' as responsive;
2+
3+
mat-card {
4+
display: flex;
5+
flex-direction: row;
6+
padding: 1rem;
7+
8+
.title {
9+
margin: 0;
10+
padding: 0 1rem;
11+
flex-wrap: wrap;
12+
display: flex;
13+
align-content: center;
14+
}
15+
}
16+
17+
img {
18+
width: 100%;
19+
}
20+
21+
[data-role='button'] {
22+
transition: 0.15s ease-out transform;
23+
&:hover {
24+
transform: scale(1.02);
25+
}
26+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { MeetupFooterComponent } from './meetup-footer.component';
4+
5+
describe('MeetupFooterComponent', () => {
6+
let component: MeetupFooterComponent;
7+
let fixture: ComponentFixture<MeetupFooterComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
imports: [MeetupFooterComponent],
12+
}).compileComponents();
13+
14+
fixture = TestBed.createComponent(MeetupFooterComponent);
15+
component = fixture.componentInstance;
16+
fixture.detectChanges();
17+
});
18+
19+
it('should create', () => {
20+
expect(component).toBeTruthy();
21+
});
22+
});
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Component } from '@angular/core';
2+
import { MatCardModule } from '@angular/material/card';
3+
import { MatRippleModule } from '@angular/material/core';
4+
5+
@Component({
6+
selector: 'blog-meetup-footer',
7+
standalone: true,
8+
imports: [MatCardModule, MatRippleModule],
9+
templateUrl: './meetup-footer.component.html',
10+
styleUrl: './meetup-footer.component.scss',
11+
})
12+
export class MeetupFooterComponent {
13+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@if (locations$ | async; as locations) {
2+
<blog-locations
3+
[locations]="locations"
4+
[active]="selectedLocation$ | async"
5+
(selected)="navigate($event)"></blog-locations>
6+
}

src/app/core/layout/locations-tab/locations-tab.component.scss

Whitespace-only changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { LocationsTabComponent } from './locations-tab.component';
4+
5+
describe('LocationsTabComponent', () => {
6+
let component: LocationsTabComponent;
7+
let fixture: ComponentFixture<LocationsTabComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
imports: [LocationsTabComponent],
12+
}).compileComponents();
13+
14+
fixture = TestBed.createComponent(LocationsTabComponent);
15+
component = fixture.componentInstance;
16+
fixture.detectChanges();
17+
});
18+
19+
it('should create', () => {
20+
expect(component).toBeTruthy();
21+
});
22+
});
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { Component } from '@angular/core';
2+
import { Observable, map } from 'rxjs';
3+
import { AsyncPipe } from '@angular/common';
4+
import { ActivatedRoute, Router } from '@angular/router';
5+
import { PostsService } from '../../services/posts.service';
6+
import { Location } from '../../model/locations.model';
7+
import { LocationsComponent } from "../../../components/locations/locations.component";
8+
9+
@Component({
10+
selector: 'blog-locations-tab',
11+
standalone: true,
12+
imports: [AsyncPipe, LocationsComponent],
13+
templateUrl: './locations-tab.component.html',
14+
styleUrl: './locations-tab.component.scss',
15+
})
16+
export class LocationsTabComponent {
17+
locations$: Observable<Location[]> = this.postsService
18+
.getLocations();
19+
20+
selectedLocation$ = this.activatedRoute.paramMap.pipe(
21+
map(params => params.get('loc') as Location)
22+
);
23+
24+
constructor(
25+
private postsService: PostsService,
26+
private router: Router,
27+
private activatedRoute: ActivatedRoute
28+
) {}
29+
30+
navigate(selected: string | string[]) {
31+
this.router.navigate(['location', selected]);
32+
}
33+
}

src/app/core/model/locations.model.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export enum Location {
2+
'Krakow' = 'Krakow',
3+
'Hyderabad' = 'Hyderabad',
4+
'Amsterdam' = 'Amsterdam',
5+
}

src/app/core/model/post.model.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Author } from './author.model';
22
import { Category } from './categories.model';
33
import { ProcessedAsset } from './content.model';
4+
import { Location } from './locations.model';
45

56
export interface Post {
67
title: string;
@@ -11,6 +12,7 @@ export interface Post {
1112
authors: Array<Author | string>;
1213
featured?: boolean;
1314
category: Category;
15+
location?: Location;
1416
tags: string[];
1517
readingTime: string;
1618
specialCategory: boolean;

0 commit comments

Comments
 (0)