Skip to content

Commit 9e67bd8

Browse files
committed
All components methods as protected
Because it helps the IDE help us find unused code that can be dropped. And it is rather rare to need them to be public.
1 parent 0eb4494 commit 9e67bd8

26 files changed

Lines changed: 38 additions & 36 deletions

File tree

client/app/admin/facilitator-documents/facilitator-document/facilitator-document.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class FacilitatorDocumentComponent extends NaturalAbstractDetail<
5959
super('facilitatorDocument', inject(FacilitatorDocumentsService));
6060
}
6161

62-
public createFileAndLink(file: File): Observable<CreateFile['createFile']> {
62+
protected createFileAndLink(file: File): Observable<CreateFile['createFile']> {
6363
return this.fileService.create({file}).pipe(
6464
switchMap(newFile => {
6565
const id = this.data.model.id;

client/app/admin/order/order/order.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class OrderComponent {
6868
});
6969
}
7070

71-
public updateStatus(status: string | string[] | null): void {
71+
protected updateStatus(status: string | string[] | null): void {
7272
if (typeof status !== 'string') {
7373
return;
7474
}

client/app/admin/products/product/product.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export class ProductComponent extends NaturalAbstractDetail<ProductService, Natu
8888
super('product', inject(ProductService));
8989
}
9090

91-
public createFileAndLink(file: File): Observable<CreateFile['createFile']> {
91+
protected createFileAndLink(file: File): Observable<CreateFile['createFile']> {
9292
return this.fileService.create({file}).pipe(
9393
switchMap(newFile => {
9494
const id = this.data.model.id;
@@ -104,7 +104,9 @@ export class ProductComponent extends NaturalAbstractDetail<ProductService, Natu
104104
);
105105
}
106106

107-
public createImageAndLink(key: 'illustration' | 'image'): (file: File) => Observable<CreateImage['createImage']> {
107+
protected createImageAndLink(
108+
key: 'illustration' | 'image',
109+
): (file: File) => Observable<CreateImage['createImage']> {
108110
return file =>
109111
this.imageService.create({file}).pipe(
110112
switchMap(image => {

client/app/admin/sessions/session/session.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export class SessionComponent extends NaturalAbstractDetail<SessionService, Natu
8080
this.form.setControl('dates', this.datesForm);
8181
}
8282

83-
public addDate(): void {
83+
protected addDate(): void {
8484
this.datesForm.push(new FormControl(''));
8585
}
8686
}

client/app/admin/users/import/import.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export class ImportComponent implements OnInit {
6161
this.routeData = this.route.snapshot.data as NaturalSeoResolveData;
6262
}
6363

64-
public uploadFile(selection: FileSelection): void {
64+
protected uploadFile(selection: FileSelection): void {
6565
this.errors = [];
6666
this.result = null;
6767
this.users = [];
@@ -118,7 +118,7 @@ export class ImportComponent implements OnInit {
118118
});
119119
}
120120

121-
public deleteAll(): void {
121+
protected deleteAll(): void {
122122
this.alertService
123123
.confirm(
124124
'Suppression',

client/app/admin/users/user/user.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export class UserComponent extends NaturalAbstractDetail<UserService, NaturalSeo
9191
});
9292
}
9393

94-
public roleDisabled(): (item: IEnum) => boolean {
94+
protected roleDisabled(): (item: IEnum) => boolean {
9595
return item => {
9696
return !this.userRolesAvailable.includes(item.value as UserRole);
9797
};

client/app/front-office/components/comment-list/comment-list.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class CommentListComponent extends NaturalAbstractList<CommentService> im
7272
}
7373
}
7474

75-
public addComment(): void {
75+
protected addComment(): void {
7676
this.publishing = true;
7777
const comment = {
7878
description: this.newCommentValue,

client/app/front-office/components/home-block/home-block.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class HomeBlockComponent implements OnInit {
7979
});
8080
}
8181

82-
public update(): void {
82+
protected update(): void {
8383
const key = this.key();
8484
this.configService.set(key + '-title', this.form.getRawValue().title);
8585
this.configService.set(key + '-description', this.form.getRawValue().description);
@@ -88,7 +88,7 @@ export class HomeBlockComponent implements OnInit {
8888
this.lastValue = this.form.getRawValue();
8989
}
9090

91-
public reset(): void {
91+
protected reset(): void {
9292
if (this.lastValue) {
9393
this.form.setValue(this.lastValue);
9494
}

client/app/front-office/components/login/login.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export class LoginComponent implements OnInit {
6161
}
6262
}
6363

64-
public maybeConfirm(): void {
64+
protected maybeConfirm(): void {
6565
ifValid(this.form).subscribe(() => this.login());
6666
}
6767

client/app/front-office/components/menu/menu.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class MenuComponent {
3535
/**
3636
* Toggle open parent nodes, and allow navigation only on children
3737
*/
38-
public clickAction(item: MenuItem, event: Event): void {
38+
protected clickAction(item: MenuItem, event: Event): void {
3939
this.data.items.forEach(i => (i.open = false));
4040

4141
if (item.children?.length) {

0 commit comments

Comments
 (0)