Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

Commit

Permalink
fixed linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Nino Di Natale committed Jan 26, 2023
1 parent 5ab654f commit 5b4872f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
9 changes: 7 additions & 2 deletions src/app/cache-reset/cache-reset.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
<h1>{{ "cache.reset.title" | translate }}</h1>
<p>{{ "cache.reset.subtitle" | translate }}</p>
<div class="container">
<mat-checkbox (change)="checkUncheckAll()" [indeterminate]="masterSelected === null && !allUnselected" [(ngModel)]="masterSelected" id="select-all-checkbox">
<b> {{ "cache.reset.select" | translate }} </b></mat-checkbox
<mat-checkbox
(change)="checkUncheckAll()"
[indeterminate]="masterSelected === null && !allUnselected"
[(ngModel)]="masterSelected"
id="select-all-checkbox"
>
<strong> {{ "cache.reset.select" | translate }} </strong></mat-checkbox
>
<div *ngFor="let item of checklist" class="caches">
<mat-checkbox (change)="isAllSelected()" [(ngModel)]="item.isSelected">{{ item.value }}</mat-checkbox>
Expand Down
8 changes: 4 additions & 4 deletions src/app/cache-reset/cache-reset.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Component} from '@angular/core';
import {CacheResetService, Caches} from './cache-reset.service';

type Checklist = { value: Caches; isSelected: boolean }[];
type Checklist = {value: Caches; isSelected: boolean}[];

@Component({
selector: 'ec-cache-reset',
Expand Down Expand Up @@ -42,11 +42,11 @@ export class CacheResetComponent {
}

isAllSelected() {
this.allUnselected = this.checklist.every(item => item.isSelected === false);
let allSelected = this.checklist.every(item => item.isSelected);
this.allUnselected = this.checklist.every(item => !item.isSelected);
const allSelected = this.checklist.every(item => item.isSelected);
if (!allSelected && this.masterSelected) {
this.masterSelected = null;
} else if (allSelected && this.masterSelected === false || allSelected && this.masterSelected === null) {
} else if ((allSelected && !this.masterSelected) || (allSelected && this.masterSelected === null)) {
this.masterSelected = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/cache-reset/cache-reset.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class CacheResetService {
constructor(private readonly http: ApiService, private readonly notificationService: ObNotificationService) {}

resetCache(selectedCaches: Caches[]) {
const cacheNames = selectedCaches.map(cache => cache.replace(/ /g,''));
const cacheNames = selectedCaches.map(cache => cache.replace(/ /g, ''));
this.http.post('caches/clear', cacheNames).subscribe(() => {
this.notificationService.success('cache.reset.success');
});
Expand Down

0 comments on commit 5b4872f

Please sign in to comment.