Skip to content

Commit

Permalink
listmonk: remove (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelCoding authored Aug 22, 2024
1 parent 6c93d36 commit 51b6ea5
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 342 deletions.
4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
15 changes: 0 additions & 15 deletions src/app/api/mailing-list.service.spec.ts

This file was deleted.

20 changes: 0 additions & 20 deletions src/app/api/mailing-list.service.ts

This file was deleted.

15 changes: 3 additions & 12 deletions src/app/core/mailing-list/mailing-list.component.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
<div class="typography">
<h2 i18n>Subscribe to the {{ listName }} mailing list</h2>
<form (submit)="$event.preventDefault();submit()" [formGroup]="form" class="form">
<feel-text-field formControlName="email" i18n-label label="E-Mail" type="text">
<feel-form-error *ngIf="form.controls?.['email']?.touched && !form.controls?.['email']?.valid" i18n>A valid
e-mail
is required!
</feel-form-error>
</feel-text-field>

<feel-button [disabled]="working || !form.valid" class="button" i18n-label label="Submit">
<app-icon-send/>
</feel-button>
</form>
<feel-button *ngIf="listId" class="button" i18n-label label="Subscribe" [link]='buildLink(listId)'>
<app-icon-send />
</feel-button>
</div>
53 changes: 8 additions & 45 deletions src/app/core/mailing-list/mailing-list.component.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
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',
templateUrl: './mailing-list.component.html',
styleUrls: ['./mailing-list.component.scss'],
imports: [
CommonModule,
ReactiveFormsModule,
CardComponent,
TextFieldComponent,
ButtonComponent,
FormErrorComponent,
IconSendComponent,
],
standalone: true
Expand All @@ -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/`;
}
}
2 changes: 1 addition & 1 deletion src/app/pages/blog/blog-list/blog-list.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ <h1 i18n>News &amp; Events</h1>

<app-card>
<div class="mailing-list">
<app-mailing-list [listId]="3" [listName]="'News'" />
<app-mailing-list listId="news" listName="News" />
</div>
</app-card>
12 changes: 0 additions & 12 deletions src/app/pages/blog/blog-subscribe/blog-subscribe.component.html

This file was deleted.

This file was deleted.

21 changes: 0 additions & 21 deletions src/app/pages/blog/blog-subscribe/blog-subscribe.component.spec.ts

This file was deleted.

17 changes: 0 additions & 17 deletions src/app/pages/blog/blog-subscribe/blog-subscribe.component.ts

This file was deleted.

6 changes: 1 addition & 5 deletions src/app/pages/blog/blog.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand Down
20 changes: 0 additions & 20 deletions src/app/pages/event/event-list/event-list.component.html

This file was deleted.

42 changes: 0 additions & 42 deletions src/app/pages/event/event-list/event-list.component.scss

This file was deleted.

21 changes: 0 additions & 21 deletions src/app/pages/event/event-list/event-list.component.spec.ts

This file was deleted.

38 changes: 0 additions & 38 deletions src/app/pages/event/event-list/event-list.component.ts

This file was deleted.

10 changes: 1 addition & 9 deletions src/app/pages/event/event.routes.ts
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Loading

0 comments on commit 51b6ea5

Please sign in to comment.