Skip to content

Commit 58469b5

Browse files
fix for build
1 parent bcd4632 commit 58469b5

File tree

3 files changed

+3
-90
lines changed

3 files changed

+3
-90
lines changed

src/app/admin/_components/add-post/add-post.component.ts

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<<<<<<< HEAD
21
import {
32
ChangeDetectionStrategy,
43
Component,
@@ -11,7 +10,6 @@ import {
1110
ViewContainerRef,
1211
} from '@angular/core';
1312
import {
14-
FormBuilder,
1513
FormControl,
1614
FormGroup,
1715
FormsModule,
@@ -30,23 +28,11 @@ import { DynamicDialogService } from '../../../shared/dynamic-dialog/dynamic-dia
3028
import { ModalConfig } from '../../../shared/_models/modal-config.intreface';
3129
import { AddImageComponent } from './add-image/add-image.component';
3230
import { AddImageForm } from './add-image/add-image-controls.interface';
33-
<<<<<<< HEAD
34-
=======
35-
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
36-
import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
37-
import { ApiService } from '../../_services/api.service';
38-
import { Firestore, FirestoreModule} from '@angular/fire/firestore';
39-
import { HttpClient } from '@angular/common/http';
40-
import { AsyncPipe } from '@angular/common';
41-
>>>>>>> ab739b9 (nothing special)
42-
=======
4331
import { Post } from '../../../types/supabase';
44-
>>>>>>> fca8c97 (ngrx signal store fixes)
4532

4633
@Component({
4734
selector: 'blog-add-post',
4835
standalone: true,
49-
<<<<<<< HEAD
5036
imports: [
5137
ReactiveFormsModule,
5238
FormsModule,
@@ -55,12 +41,8 @@ import { Post } from '../../../types/supabase';
5541
RouterModule,
5642
],
5743
providers: [AdminApiService, NgModel],
58-
=======
59-
imports: [ReactiveFormsModule, FirestoreModule, AsyncPipe],
60-
providers: [ApiService, HttpClient],
61-
>>>>>>> ab739b9 (nothing special)
6244
templateUrl: './add-post.component.html',
63-
styleUrl: './add-post.component.scss',
45+
styleUrls: ['./add-post.component.scss'],
6446
schemas: [CUSTOM_ELEMENTS_SCHEMA],
6547
changeDetection: ChangeDetectionStrategy.OnPush,
6648
})
@@ -88,28 +70,9 @@ export class AddPostComponent implements OnInit {
8870

8971
private apiService = inject(AdminApiService);
9072

91-
<<<<<<< HEAD
92-
constructor() {
93-
this.blogForm = this.fb.group({
94-
title: ['', [Validators.required]],
95-
content: ['', [Validators.required]],
96-
<<<<<<< HEAD
97-
<<<<<<< HEAD
98-
date: new Timestamp(0, 0),
99-
=======
100-
date: null,
101-
>>>>>>> 34e7e50 (supabase added, firebase removed)
102-
description: [null],
103-
isDraft: [false],
104-
}) as FormGroup<PostForm>;
105-
=======
106-
});
107-
>>>>>>> ab739b9 (nothing special)
108-
=======
10973
ngOnInit(): void {
11074
this.loadPostIfIdExists();
11175
this.initializeQuill();
112-
>>>>>>> cbcd61c (fix lame code)
11376
}
11477

11578
private loadPostIfIdExists(): void {
@@ -231,12 +194,11 @@ export class AddPostComponent implements OnInit {
231194
index: number,
232195
stringToInsert: string,
233196
): string {
234-
const result = [
197+
return [
235198
...originalString.slice(0, index),
236199
...stringToInsert,
237200
...originalString.slice(index),
238201
].join('');
239-
return result;
240202
}
241203

242204
@HostListener('window:beforeunload', ['$event'])
Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,16 @@
11
import { inject } from '@angular/core';
22
import { CanMatchFn, Router } from '@angular/router';
3-
<<<<<<< HEAD
4-
<<<<<<< HEAD
5-
import { AuthService } from '../auth.service';
6-
=======
7-
>>>>>>> 34e7e50 (supabase added, firebase removed)
8-
import { Roles } from '../../shared/_enums/roles';
9-
<<<<<<< HEAD
10-
=======
11-
import { Observable } from 'rxjs';
12-
import { map, take } from 'rxjs/operators';
13-
import { AuthService } from '../auth.service';
14-
>>>>>>> 2ca65a2 (auth guard moved to auth folder)
15-
=======
163
import { SupabaseService } from '../../services/supabase.service';
17-
>>>>>>> 793fe4a (login fixed)
4+
import { Roles } from '../../shared/_enums/roles';
185

196
export const authAdminGuard: CanMatchFn = (): boolean => {
207
const supabaseService = inject(SupabaseService);
218
const router = inject(Router);
22-
<<<<<<< HEAD
23-
24-
<<<<<<< HEAD
25-
<<<<<<< HEAD
26-
if (authService.user$()?.roles?.includes(Roles.ADMIN)) {
27-
=======
28-
console.log('GUARD', authService.isAdmin$());
29-
if (authService.isAdmin$()) {
30-
>>>>>>> 2ca65a2 (auth guard moved to auth folder)
31-
=======
329
const session = supabaseService.getSession();
33-
34-
<<<<<<< HEAD:src/app/auth/_guards/auth.guard.ts
35-
// For now, just check if the user is authenticated
36-
// In a real application, you would check for specific roles in the user's metadata
37-
if (session) {
38-
>>>>>>> 793fe4a (login fixed)
39-
=======
4010
if (session?.user?.app_metadata?.['role'] === Roles.ADMIN) {
41-
>>>>>>> bc9c691 (wip):src/app/auth/_guards/authAdminGuard.ts
4211
return true;
4312
} else {
4413
router.navigate(['/posts']);
4514
return false;
4615
}
47-
<<<<<<< HEAD
48-
<<<<<<< HEAD
49-
=======
50-
51-
>>>>>>> 2ca65a2 (auth guard moved to auth folder)
52-
=======
53-
// if (authService.user$()?.roles?.includes(Roles.ADMIN)) {
54-
// return true;
55-
// } else {
56-
// router.navigate(['/posts']);
57-
// return false;
58-
// }
59-
return true;
60-
>>>>>>> 34e7e50 (supabase added, firebase removed)
61-
=======
62-
>>>>>>> 793fe4a (login fixed)
6316
};

src/app/reader/_components/main-page/post/comments/comments.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
Input,
55
inject,
66
input,
7-
InputSignal,
87
} from '@angular/core';
98
import { ReaderApiService } from '../../../../_services/reader-api.service';
109
import { Comment } from '../../../../../types/supabase';
@@ -24,7 +23,6 @@ export class CommentsComponent {
2423
@Input() postId!: string;
2524
comments = input<Comment[]>();
2625

27-
private apiService = inject(ReaderApiService);
2826
private commentsStore = inject(CommentsStore);
2927

3028
deleteComment(commentId: string): void {

0 commit comments

Comments
 (0)