Skip to content

Commit fe23fa4

Browse files
authored
added sorting for location pages and changed default count items for … (#167)
* added sorting for location pages and changed default count items for each page * prettier * fix comment * fix comment
1 parent a8cb49c commit fe23fa4

File tree

65 files changed

+570
-384
lines changed

Some content is hidden

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

65 files changed

+570
-384
lines changed

src/app/app.component.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ import { FooterComponent } from './core/layout/footer/footer.component';
66
@Component({
77
selector: 'blog-root',
88
standalone: true,
9-
imports: [
10-
NavigationComponent,
11-
FooterComponent,
12-
RouterOutlet
13-
],
9+
imports: [NavigationComponent, FooterComponent, RouterOutlet],
1410
templateUrl: './app.component.html',
1511
styleUrls: ['./app.component.scss'],
1612
})

src/app/app.config.ts

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
provideRouter,
1111
withComponentInputBinding,
1212
withInMemoryScrolling,
13-
withRouterConfig
13+
withRouterConfig,
1414
} from '@angular/router';
1515

1616
import { routes } from './app.routes';
@@ -24,7 +24,7 @@ import {
2424
AUTHORS_AVATAR_PATH_TOKEN,
2525
USE_PROCESSED_IMAGES,
2626
O11Y_CONFIG_TOKEN,
27-
SPECIAL_CATEGORIES
27+
SPECIAL_CATEGORIES,
2828
} from './core/config/configuration-tokens';
2929
import { HtmlInMarkdownService } from './core/services/html-in-markdown.service';
3030
import { ObservabilityConfig } from './core/model/observability.model';
@@ -68,8 +68,17 @@ export const appConfig: ApplicationConfig = {
6868
{
6969
provide: APP_INITIALIZER,
7070
multi: true,
71-
useFactory: (...deps: any) => () => markdownConfig.apply(this, deps),
72-
deps: [MarkdownService, DOCUMENT, HtmlInMarkdownService, AssetsService, Router],
71+
useFactory:
72+
(...deps: any) =>
73+
() =>
74+
markdownConfig.apply(this, deps),
75+
deps: [
76+
MarkdownService,
77+
DOCUMENT,
78+
HtmlInMarkdownService,
79+
AssetsService,
80+
Router,
81+
],
7382
},
7483
{
7584
provide: APP_INITIALIZER,
@@ -84,12 +93,10 @@ export const appConfig: ApplicationConfig = {
8493
{
8594
provide: USE_PROCESSED_IMAGES,
8695
useValue: !isDevMode(),
87-
},{
96+
},
97+
{
8898
provide: SPECIAL_CATEGORIES,
89-
useValue: [
90-
'principles',
91-
'meetups',
92-
]
93-
}
99+
useValue: ['principles', 'meetups'],
100+
},
94101
],
95102
};

src/app/app.meta.config.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { MetaDefinition } from "@angular/platform-browser";
2-
import { PostContent } from "./core/model/post.model";
1+
import { MetaDefinition } from '@angular/platform-browser';
2+
import { PostContent } from './core/model/post.model';
33

44
const prodUrl = 'https://engineering.backbase.com/';
55
const rootTitle = 'Backbase Engineering';
6-
const rootDescription = 'Backbase is a global fintech company creating the best digital banking solutions on the planet. We are a young-spirited, diverse (45+ nationalities), fast-growing and leading company in our niche.';
6+
const rootDescription =
7+
'Backbase is a global fintech company creating the best digital banking solutions on the planet. We are a young-spirited, diverse (45+ nationalities), fast-growing and leading company in our niche.';
78

89
export const defaultMeta: MetaDefinition[] = [
910
{
@@ -36,10 +37,13 @@ export const notFoundMeta: MetaDefinition[] = [
3637
{
3738
name: 'robots',
3839
content: 'noindex, nofollow',
39-
}
40-
]
40+
},
41+
];
4142

42-
export const getPostMeta = ({ excerpt, title, displayTeaser }: PostContent, url: string) => [
43+
export const getPostMeta = (
44+
{ excerpt, title, displayTeaser }: PostContent,
45+
url: string
46+
) => [
4347
{
4448
name: 'description',
4549
content: excerpt,
@@ -60,4 +64,4 @@ export const getPostMeta = ({ excerpt, title, displayTeaser }: PostContent, url:
6064
property: 'og:description',
6165
content: excerpt,
6266
},
63-
];
67+
];

src/app/app.routes.map.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import { Route } from '@angular/router';
22

33
const routes = [
4-
['2023/12/13/angular-micro-frontends', '2023/12/13/micro-frontends-with-module-federation'],
5-
['2023/12/13/setup-microfrontend', '2023/12/13/micro-frontends-with-module-federation'],
4+
[
5+
'2023/12/13/angular-micro-frontends',
6+
'2023/12/13/micro-frontends-with-module-federation',
7+
],
8+
[
9+
'2023/12/13/setup-microfrontend',
10+
'2023/12/13/micro-frontends-with-module-federation',
11+
],
612
['2023/10/06/code-coverage', '2023/10/06/code-coverage-for-unit-tests'],
713
[
814
'2023/09/30/installing-hms-core-in-as-emulator',

src/app/app.routes.ts

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
import { ActivatedRouteSnapshot, Route, Router, RouterStateSnapshot, Routes } from '@angular/router';
1+
import {
2+
ActivatedRouteSnapshot,
3+
Route,
4+
Router,
5+
RouterStateSnapshot,
6+
Routes,
7+
} from '@angular/router';
28
import { postRedirects } from './app.routes.map';
39
import { EMPTY, Subject, catchError, map, tap } from 'rxjs';
410
import { inject, makeStateKey, TransferState } from '@angular/core';
@@ -18,12 +24,16 @@ export const routes: Routes = [
1824
{
1925
path: '',
2026
loadComponent: () =>
21-
import('./features/home/home.component').then(mod => mod.HomeComponent),
27+
import('./features/home/home.component').then(
28+
mod => mod.HomeComponent
29+
),
2230
},
2331
{
2432
path: 'people/:author',
2533
loadComponent: () =>
26-
import('./features/author/author.component').then(m => m.AuthorComponent),
34+
import('./features/author/author.component').then(
35+
m => m.AuthorComponent
36+
),
2737
},
2838
{
2939
path: ':year/:month/:day/:permalink',
@@ -92,8 +102,8 @@ export const routes: Routes = [
92102
),
93103
data: { meta: notFoundMeta },
94104
},
95-
]
96-
}
105+
],
106+
},
97107
];
98108

99109
function getRouteData(): Partial<Route> {
@@ -106,41 +116,57 @@ function getRouteData(): Partial<Route> {
106116
const transferState = inject(TransferState);
107117
const stateKey = makeStateKey<PostContent | undefined>(url);
108118
if (transferState.hasKey(stateKey)) {
109-
const post = transferState.get<PostContent | undefined>(stateKey, undefined);
119+
const post = transferState.get<PostContent | undefined>(
120+
stateKey,
121+
undefined
122+
);
110123
postData.next(post as PostContent);
111124
return post;
112125
}
113-
return inject(PostsService).getPost(url)
126+
return inject(PostsService)
127+
.getPost(url)
114128
.pipe(
115129
tap(post => {
116130
transferState.set<PostContent>(stateKey, post);
117-
postData.next(post)}
118-
),
131+
postData.next(post);
132+
}),
119133
catchError((_: any) => {
120134
router.navigate(['**'], { skipLocationChange: true });
121135
return EMPTY;
122136
})
123-
)
137+
);
124138
},
125139
meta: (activatedRoute: ActivatedRouteSnapshot) => {
126140
const url = activatedRoute.url.map(({ path }) => path).join('/');
127141
const transferState = inject(TransferState);
128142
const stateKey = makeStateKey<PostContent | undefined>(url);
129143
if (transferState.hasKey(stateKey)) {
130-
return getPostMeta(transferState.get<PostContent | undefined>(stateKey, undefined) as PostContent, url);
144+
return getPostMeta(
145+
transferState.get<PostContent | undefined>(
146+
stateKey,
147+
undefined
148+
) as PostContent,
149+
url
150+
);
131151
}
132-
return postData.pipe(map((post) => getPostMeta(post, url)));
133-
}
152+
return postData.pipe(map(post => getPostMeta(post, url)));
153+
},
134154
},
135155
title: (activatedRoute: ActivatedRouteSnapshot) => {
136156
const url = activatedRoute.url.map(({ path }) => path).join('/');
137157
const transferState = inject(TransferState);
138158
const stateKey = makeStateKey<PostContent | undefined>(url);
139-
const getTitle = ({ title }: PostContent) => `${title} | ${activatedRoute.parent?.title}`;
159+
const getTitle = ({ title }: PostContent) =>
160+
`${title} | ${activatedRoute.parent?.title}`;
140161
if (transferState.hasKey(stateKey)) {
141-
return getTitle(transferState.get<PostContent | undefined>(stateKey, undefined) as PostContent);
162+
return getTitle(
163+
transferState.get<PostContent | undefined>(
164+
stateKey,
165+
undefined
166+
) as PostContent
167+
);
142168
}
143-
return postData.pipe(map((post) => getTitle(post)));
144-
}
145-
}
169+
return postData.pipe(map(post => getTitle(post)));
170+
},
171+
};
146172
}

src/app/components/author/author.component.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
sm: size === 'sm',
66
md: size === 'md',
77
lg: size === 'lg',
8-
muted: muted
8+
muted: muted,
99
}">
1010
<blog-avatar
1111
class="author__avatar"
1212
[url]="author.displayAvatar?.[size]"
13-
format="circle"
14-
></blog-avatar>
13+
format="circle"></blog-avatar>
1514
<div class="author__details">
1615
<div class="author__fullname">{{ author.fullname }}</div>
1716
@if (size === 'lg') {

src/app/components/author/author.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,4 @@ export class AuthorComponent {
2929
@Input() muted = false;
3030

3131
author!: Author;
32-
3332
}

0 commit comments

Comments
 (0)