From 51b6ea50d38a1ea00a1a98cda922b28a59b6a3f8 Mon Sep 17 00:00:00 2001 From: Marcel <34819524+MarcelCoding@users.noreply.github.com> Date: Thu, 22 Aug 2024 22:01:29 +0200 Subject: [PATCH] listmonk: remove (#87) --- flake.nix | 4 +- src/app/api/mailing-list.service.spec.ts | 15 ----- src/app/api/mailing-list.service.ts | 20 ------ .../mailing-list/mailing-list.component.html | 15 +---- .../mailing-list/mailing-list.component.ts | 53 +++------------ .../blog/blog-list/blog-list.component.html | 2 +- .../blog-subscribe.component.html | 12 ---- .../blog-subscribe.component.scss | 3 - .../blog-subscribe.component.spec.ts | 21 ------ .../blog-subscribe.component.ts | 17 ----- src/app/pages/blog/blog.routes.ts | 6 +- .../event-list/event-list.component.html | 20 ------ .../event-list/event-list.component.scss | 42 ------------ .../event-list/event-list.component.spec.ts | 21 ------ .../event/event-list/event-list.component.ts | 38 ----------- src/app/pages/event/event.routes.ts | 10 +-- src/locales/en_devel.xlf | 65 ++----------------- 17 files changed, 22 insertions(+), 342 deletions(-) delete mode 100644 src/app/api/mailing-list.service.spec.ts delete mode 100644 src/app/api/mailing-list.service.ts delete mode 100644 src/app/pages/blog/blog-subscribe/blog-subscribe.component.html delete mode 100644 src/app/pages/blog/blog-subscribe/blog-subscribe.component.scss delete mode 100644 src/app/pages/blog/blog-subscribe/blog-subscribe.component.spec.ts delete mode 100644 src/app/pages/blog/blog-subscribe/blog-subscribe.component.ts delete mode 100644 src/app/pages/event/event-list/event-list.component.html delete mode 100644 src/app/pages/event/event-list/event-list.component.scss delete mode 100644 src/app/pages/event/event-list/event-list.component.spec.ts delete mode 100644 src/app/pages/event/event-list/event-list.component.ts diff --git a/flake.nix b/flake.nix index 58eb37b..129aa72 100644 --- a/flake.nix +++ b/flake.nix @@ -20,11 +20,11 @@ { packages = rec { website = pkgs.callPackage ./derivation.nix { - contentApi = "content.dd-ix.net"; + contentApi = "https://content.dd-ix.net"; mkPnpmPackage = pnpm2nix.packages."${system}".mkPnpmPackage; }; website-static = pkgs.callPackage ./derivation.nix { - contentApi = "content.dd-ix.net"; + contentApi = "https://content.dd-ix.net"; static = true; mkPnpmPackage = pnpm2nix.packages."${system}".mkPnpmPackage; }; 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..71e6675 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-list/blog-list.component.html b/src/app/pages/blog/blog-list/blog-list.component.html index be10378..97b3d0c 100644 --- a/src/app/pages/blog/blog-list/blog-list.component.html +++ b/src/app/pages/blog/blog-list/blog-list.component.html @@ -22,6 +22,6 @@

News & Events

- +
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) }, diff --git a/src/app/pages/event/event-list/event-list.component.html b/src/app/pages/event/event-list/event-list.component.html deleted file mode 100644 index 8adc6ae..0000000 --- a/src/app/pages/event/event-list/event-list.component.html +++ /dev/null @@ -1,20 +0,0 @@ -
-
-

Events

- - - -
-
- - - - -
- -
-
diff --git a/src/app/pages/event/event-list/event-list.component.scss b/src/app/pages/event/event-list/event-list.component.scss deleted file mode 100644 index 2377906..0000000 --- a/src/app/pages/event/event-list/event-list.component.scss +++ /dev/null @@ -1,42 +0,0 @@ -@import "vars"; - -ul { - display: flex; - flex-direction: column; - gap: 1rem; - margin-bottom: 4rem; -} - -.news { - list-style-type: none; -} - -.mailing-list { - max-width: 36rem; -} - -.keywords { - display: flex; - gap: 1rem; - margin-bottom: 1rem; - flex-wrap: wrap; - - .keyword { - background-color: $c-card; - border: 0.1rem solid $c-card-secondary; - padding: 0.2rem 0.6rem; - border-radius: 5rem; - cursor: pointer; - outline: none; - - &.selected { - background-color: $c-primary; - } - } -} - -.header { - display: flex; - justify-content: space-between; - margin: 1rem; -} diff --git a/src/app/pages/event/event-list/event-list.component.spec.ts b/src/app/pages/event/event-list/event-list.component.spec.ts deleted file mode 100644 index 703bc75..0000000 --- a/src/app/pages/event/event-list/event-list.component.spec.ts +++ /dev/null @@ -1,21 +0,0 @@ -import {ComponentFixture, TestBed} from '@angular/core/testing'; - -import {EventListComponent} from './event-list.component'; - -describe('NewsListComponent', () => { - let component: EventListComponent; - let fixture: ComponentFixture; - - beforeEach(() => { - TestBed.configureTestingModule({ - declarations: [EventListComponent] - }); - fixture = TestBed.createComponent(EventListComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/pages/event/event-list/event-list.component.ts b/src/app/pages/event/event-list/event-list.component.ts deleted file mode 100644 index c2eacee..0000000 --- a/src/app/pages/event/event-list/event-list.component.ts +++ /dev/null @@ -1,38 +0,0 @@ -import {ChangeDetectionStrategy, Component} from '@angular/core'; -import {BlogService} from "../../../api/blog.service"; -import {BehaviorSubject, map, Observable, switchMap} from "rxjs"; -import {AsyncPipe, NgForOf, NgIf} from "@angular/common"; -import {BlogCardComponent} from "../../../core/blog-card/blog-card.component"; -import {CardComponent} from "../../../core/card/card.component"; -import {MailingListComponent} from "../../../core/mailing-list/mailing-list.component"; -import {EventCardComponent} from "../../../core/event-card/event-card.component"; -import {ButtonComponent} from "@feel/form"; -import {IconSendComponent} from "../../../icons/icon-send/icon-send.component"; - -@Component({ - selector: 'app-blog-list', - templateUrl: './event-list.component.html', - styleUrls: ['./event-list.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, - standalone: true, - imports: [ - AsyncPipe, - NgIf, - NgForOf, - BlogCardComponent, - CardComponent, - MailingListComponent, - EventCardComponent, - ButtonComponent, - IconSendComponent - ] -}) -export class EventListComponent { - - protected readonly events = this.blogService.getEventPosts(); - - constructor( - private readonly blogService: BlogService, - ) { - } -} diff --git a/src/app/pages/event/event.routes.ts b/src/app/pages/event/event.routes.ts index b9fb9a0..e25e69d 100644 --- a/src/app/pages/event/event.routes.ts +++ b/src/app/pages/event/event.routes.ts @@ -1,14 +1,6 @@ -import {Routes} from '@angular/router'; +import { Routes } from '@angular/router'; export const routes: Routes = [ - { - path: '', - loadComponent: () => import("./event-list/event-list.component").then(c => c.EventListComponent), - }, - { - path: 'subscribe', - loadComponent: () => import("../blog/blog-subscribe/blog-subscribe.component").then(c => c.BlogSubscribeComponent) - }, { path: ':slug', loadComponent: () => import("./event-post/event-post.component").then(c => c.EventPostComponent) diff --git a/src/locales/en_devel.xlf b/src/locales/en_devel.xlf index 912a4fe..2548838 100644 --- a/src/locales/en_devel.xlf +++ b/src/locales/en_devel.xlf @@ -48,10 +48,6 @@ src/app/api/team.domain.ts 23 - - src/app/pages/event/event-list/event-list.component.html - 3,4 - Finance and Legal @@ -300,39 +296,11 @@ 2,3 - - E-Mail - - src/app/core/mailing-list/mailing-list.component.html - 4 - - - - A valid e-mail is required! + + Subscribe src/app/core/mailing-list/mailing-list.component.html - 6,7 - - - - Submit - - src/app/core/mailing-list/mailing-list.component.html - 12 - - - - Successfully subscribed to mailing list. - - src/app/core/mailing-list/mailing-list.component.ts - 57 - - - - Failed to subscribe to mailing list. - - src/app/core/mailing-list/mailing-list.component.ts - 61 + 3 @@ -461,20 +429,6 @@ 9,10 - - Mailing List - - src/app/pages/blog/blog-subscribe/blog-subscribe.component.html - 2,3 - - - - Always stay updated by subscribing to our news mailing-list. - - src/app/pages/blog/blog-subscribe/blog-subscribe.component.html - 4,6 - - General @@ -503,13 +457,6 @@ 60,61 - - Blog! - - src/app/pages/event/event-list/event-list.component.html - 4 - - Keep Local Traffic Local @@ -581,21 +528,21 @@ Socials src/app/pages/home/home.component.html - 77,78 + 86,87 Our Sustaining Members src/app/pages/home/home.component.html - 104,105 + 113,114 Our Patrons src/app/pages/home/home.component.html - 131,132 + 140,141