diff --git a/src/app/api/mailing-list.service.spec.ts b/src/app/api/mailing-list.service.spec.ts deleted file mode 100644 index 93bd9f8..0000000 --- a/src/app/api/mailing-list.service.spec.ts +++ /dev/null @@ -1,15 +0,0 @@ -import {TestBed} from '@angular/core/testing'; -import {MailingListService} from './mailing-list.service'; - -describe('MailingListService', () => { - let service: MailingListService; - - beforeEach(() => { - TestBed.configureTestingModule({}); - service = TestBed.inject(MailingListService); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); -}); diff --git a/src/app/api/mailing-list.service.ts b/src/app/api/mailing-list.service.ts deleted file mode 100644 index e23491d..0000000 --- a/src/app/api/mailing-list.service.ts +++ /dev/null @@ -1,20 +0,0 @@ -import {Injectable} from '@angular/core'; -import { HttpClient } from "@angular/common/http"; -import {API_URL} from "./api.domain"; -import {map, Observable} from "rxjs"; - -@Injectable({ - providedIn: 'root' -}) -export class MailingListService { - - constructor( - private readonly http: HttpClient - ) { - } - - public subscribe(listId: number, email: string): Observable { - return this.http.post(`${API_URL}/mailing_lists/${listId}`, {email}) - .pipe(map(() => void 0)); - } -} diff --git a/src/app/core/mailing-list/mailing-list.component.html b/src/app/core/mailing-list/mailing-list.component.html index fe0ce62..f975acf 100644 --- a/src/app/core/mailing-list/mailing-list.component.html +++ b/src/app/core/mailing-list/mailing-list.component.html @@ -1,15 +1,6 @@

Subscribe to the {{ listName }} mailing list

-
- - A valid - e-mail - is required! - - - - - - -
+ + +
diff --git a/src/app/core/mailing-list/mailing-list.component.ts b/src/app/core/mailing-list/mailing-list.component.ts index 814de42..186c72c 100644 --- a/src/app/core/mailing-list/mailing-list.component.ts +++ b/src/app/core/mailing-list/mailing-list.component.ts @@ -1,11 +1,8 @@ -import {Component, Input} from '@angular/core'; -import {FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms' -import {CardComponent} from "../card/card.component"; -import {CommonModule} from "@angular/common"; -import {MailingListService} from "../../api/mailing-list.service"; -import {ButtonComponent, FormErrorComponent, TextFieldComponent} from "@feel/form"; -import {IconSendComponent} from "../../icons/icon-send/icon-send.component"; -import {NotificationService} from "@feel/notification"; +import { Component, Input } from '@angular/core'; +import { CardComponent } from "../card/card.component"; +import { CommonModule } from "@angular/common"; +import { ButtonComponent } from "@feel/form"; +import { IconSendComponent } from "../../icons/icon-send/icon-send.component"; @Component({ selector: 'app-mailing-list', @@ -13,11 +10,8 @@ import {NotificationService} from "@feel/notification"; styleUrls: ['./mailing-list.component.scss'], imports: [ CommonModule, - ReactiveFormsModule, CardComponent, - TextFieldComponent, ButtonComponent, - FormErrorComponent, IconSendComponent, ], standalone: true @@ -27,40 +21,9 @@ export class MailingListComponent { @Input() public listName: string | null = null; @Input() - public listId: number | null = null; - protected form = new FormGroup({ - email: new FormControl(null, [Validators.required, Validators.email]), - }); - protected working = false; + public listId: string | null = null; - constructor( - private readonly mailingListService: MailingListService, - private readonly notificationService: NotificationService, - ) { - } - - protected submit(): void { - if (!Number.isFinite(this.listId)) { - throw new Error("Mailing list not defined"); - } - - if (this.working || !this.form.valid) { - return; - } - - const value = this.form.value; - - this.working = true; - this.mailingListService.subscribe(this.listId!, value.email!) - .subscribe({ - next: () => { - this.notificationService.success($localize`Successfully subscribed to mailing list.`); - }, - error: err => { - console.error(err); - this.notificationService.error($localize`Failed to subscribe to mailing list.`); - }, - complete: () => this.working = false, - }); + protected buildLink(listId: string): string { + return `https://lists.dd-ix.net/postorius/lists/${listId}.lists.dd-ix.net/`; } } diff --git a/src/app/pages/blog/blog-subscribe/blog-subscribe.component.html b/src/app/pages/blog/blog-subscribe/blog-subscribe.component.html deleted file mode 100644 index 9a3ab93..0000000 --- a/src/app/pages/blog/blog-subscribe/blog-subscribe.component.html +++ /dev/null @@ -1,12 +0,0 @@ -
-

Mailing List

-

- Always stay updated by subscribing to our news mailing-list. -

-
- - -
- -
-
diff --git a/src/app/pages/blog/blog-subscribe/blog-subscribe.component.scss b/src/app/pages/blog/blog-subscribe/blog-subscribe.component.scss deleted file mode 100644 index 3f5f282..0000000 --- a/src/app/pages/blog/blog-subscribe/blog-subscribe.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.body { - margin-bottom: 1rem; -} diff --git a/src/app/pages/blog/blog-subscribe/blog-subscribe.component.spec.ts b/src/app/pages/blog/blog-subscribe/blog-subscribe.component.spec.ts deleted file mode 100644 index 698a56f..0000000 --- a/src/app/pages/blog/blog-subscribe/blog-subscribe.component.spec.ts +++ /dev/null @@ -1,21 +0,0 @@ -import {ComponentFixture, TestBed} from '@angular/core/testing'; - -import {BlogSubscribeComponent} from './blog-subscribe.component'; - -describe('NewsSubscribeComponent', () => { - let component: BlogSubscribeComponent; - let fixture: ComponentFixture; - - beforeEach(() => { - TestBed.configureTestingModule({ - declarations: [BlogSubscribeComponent] - }); - fixture = TestBed.createComponent(BlogSubscribeComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/pages/blog/blog-subscribe/blog-subscribe.component.ts b/src/app/pages/blog/blog-subscribe/blog-subscribe.component.ts deleted file mode 100644 index f3bbbc0..0000000 --- a/src/app/pages/blog/blog-subscribe/blog-subscribe.component.ts +++ /dev/null @@ -1,17 +0,0 @@ -import {Component} from '@angular/core'; -import {CardComponent} from "../../../core/card/card.component"; -import {MailingListComponent} from "../../../core/mailing-list/mailing-list.component"; - -@Component({ - selector: 'app-blog-subscribe', - templateUrl: './blog-subscribe.component.html', - styleUrls: ['./blog-subscribe.component.scss'], - standalone: true, - imports: [ - CardComponent, - MailingListComponent - ] -}) -export class BlogSubscribeComponent { - -} diff --git a/src/app/pages/blog/blog.routes.ts b/src/app/pages/blog/blog.routes.ts index 71e6fbb..aad354a 100644 --- a/src/app/pages/blog/blog.routes.ts +++ b/src/app/pages/blog/blog.routes.ts @@ -5,11 +5,7 @@ export const routes: Routes = [ path: '', loadComponent: () => import("./blog-list/blog-list.component").then(c => c.BlogListComponent), }, - { - path: 'subscribe', - loadComponent: () => import("./blog-subscribe/blog-subscribe.component").then(c => c.BlogSubscribeComponent) - }, - { + { path: ':slug', loadComponent: () => import("./blog-post/blog-post.component").then(c => c.BlogPostComponent) },