Skip to content

Commit 5a2cc21

Browse files
authored
Merge pull request #28
Rename subscriptions to feed
2 parents 95d3ce4 + 0e95a3e commit 5a2cc21

File tree

21 files changed

+144
-112
lines changed

21 files changed

+144
-112
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@emp74ark/rss-angular",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"description": "Frontend for RSS Feeds client",
55
"author": "emp74ark",
66
"private": true,

src/app/app.routes.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ export const routes: Routes = [
2424
canMatch: [authGuard],
2525
},
2626
{
27-
path: 'subscriptions',
27+
path: 'feeds',
2828
loadComponent: async () => {
29-
const c = await import('./pages/subscriptions-page/subscriptions-page')
30-
return c.SubscriptionsPage
29+
const c = await import('./pages/feeds-page/feeds-page')
30+
return c.FeedsPage
3131
},
32-
data: { title: 'Subscriptions' },
32+
data: { title: 'Feeds' },
3333
canMatch: [authGuard],
3434
},
3535
{
36-
path: 'subscription/:subscriptionId/article/:articleId',
36+
path: 'feed/:feedId/article/:articleId',
3737
loadComponent: async () => {
3838
const c = await import('./pages/article-page/article-page')
3939
return c.ArticlePage

src/app/components/article-list/article-list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<mat-icon>link</mat-icon>
3333
</a>
3434
<a
35-
routerLink="/subscription/{{ a.subscriptionId }}/article/{{ a._id }}"
35+
routerLink="/feed/{{ a.feedId }}/article/{{ a._id }}"
3636
matIconButton
3737
title="Open the article"
3838
>

src/app/components/article-list/article-list.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
import { ChangeDetectionStrategy, Component, DestroyRef, effect, inject, input, linkedSignal } from '@angular/core'
1+
import {
2+
ChangeDetectionStrategy,
3+
Component,
4+
DestroyRef,
5+
effect,
6+
inject,
7+
input,
8+
linkedSignal,
9+
} from '@angular/core'
210
import { AsyncPipe, DatePipe } from '@angular/common'
311
import {
412
MatCard,
@@ -68,7 +76,7 @@ export class ArticleList {
6876
$display = this.pageService.$display
6977

7078
async onArticleClick(article: Article) {
71-
await this.router.navigate(['subscription', article.subscriptionId, 'article', article._id])
79+
await this.router.navigate(['feed', article.feedId, 'article', article._id])
7280
}
7381

7482
markAsRead(article: Article, event: MouseEvent) {

src/app/components/bottom-error-sheet/bottom-error-sheet.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { MatError } from '@angular/material/form-field'
66
selector: 'app-bottom-error-sheet',
77
imports: [MatBottomSheetModule, MatError],
88
templateUrl: './bottom-error-sheet.html',
9-
styleUrl: './bottom-error-sheet.css'
9+
styleUrl: './bottom-error-sheet.css',
1010
})
1111
export class BottomErrorSheet {
1212
readonly data: { error?: string } = inject(MAT_BOTTOM_SHEET_DATA)

src/app/components/subscription-add-form/subscription-add-form.html renamed to src/app/components/feed-add-form/feed-add-form.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h2 matDialogTitle>Add new subscription</h2>
1+
<h2 matDialogTitle>Add new feed</h2>
22
<form
33
matDialogContent
44
[formGroup]="form"
@@ -8,7 +8,7 @@ <h2 matDialogTitle>Add new subscription</h2>
88
<mat-label>Title</mat-label>
99
<input
1010
matInput
11-
placeholder="Subscription title"
11+
placeholder="Feed title"
1212
type="text"
1313
formControlName="title"
1414
/>
@@ -33,7 +33,6 @@ <h2 matDialogTitle>Add new subscription</h2>
3333
</mat-form-field>
3434
<ng-container formGroupName="settings">
3535
<mat-slide-toggle formControlName="enabled">Enabled</mat-slide-toggle>
36-
<mat-slide-toggle formControlName="loadFullText">Load full text</mat-slide-toggle>
3736
</ng-container>
3837

3938
@if (errorMessage()) {

src/app/components/subscription-add-form/subscription-add-form.ts renamed to src/app/components/feed-add-form/feed-add-form.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { HttpErrorResponse } from '@angular/common/http'
1111
import { takeUntilDestroyed } from '@angular/core/rxjs-interop'
1212

1313
@Component({
14-
selector: 'app-subscription-add-form',
14+
selector: 'app-feed-add-form',
1515
imports: [
1616
ReactiveFormsModule,
1717
MatFormFieldModule,
@@ -20,15 +20,15 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop'
2020
MatDialogModule,
2121
MatButton,
2222
],
23-
templateUrl: './subscription-add-form.html',
24-
styleUrl: './subscription-add-form.css',
23+
templateUrl: './feed-add-form.html',
24+
styleUrl: './feed-add-form.css',
2525
changeDetection: ChangeDetectionStrategy.OnPush,
2626
})
27-
export class SubscriptionAddForm {
27+
export class FeedAddForm {
2828
private readonly fb = inject(NonNullableFormBuilder)
2929
private readonly feedService = inject(FeedService)
3030
private readonly destroyRef = inject(DestroyRef)
31-
private readonly dialogRef = inject(MatDialogRef<SubscriptionAddForm>)
31+
private readonly dialogRef = inject(MatDialogRef<FeedAddForm>)
3232

3333
readonly isLoading = signal<boolean>(false)
3434
readonly errorMessage = signal<string | null>(null)
@@ -39,15 +39,14 @@ export class SubscriptionAddForm {
3939
link: ['', Validators.required],
4040
settings: this.fb.group({
4141
enabled: [true],
42-
loadFullText: [false],
4342
}),
4443
})
4544

4645
onSubmit(): void {
4746
this.isLoading.set(true)
4847
this.form.disable()
4948
this.feedService
50-
.addOneSubscription({ subscription: this.form.getRawValue() })
49+
.addOneFeed({ feed: this.form.getRawValue() })
5150
.pipe(
5251
catchError((error: HttpErrorResponse) => {
5352
this.errorMessage.set(error.error.message)

0 commit comments

Comments
 (0)